mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
ordenes trabajo
This commit is contained in:
25
ci4/app/Helpers/time_helper.php
Normal file
25
ci4/app/Helpers/time_helper.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// app/Helpers/info_helper.php
|
||||
use CodeIgniter\CodeIgniter;
|
||||
|
||||
function float_seconds_to_hhmm_string(?float $time):?string
|
||||
{
|
||||
$time_str = null;
|
||||
if($time){
|
||||
$time_str = sprintf("%02d:%02d",$time/3600,floor($time/60)%60);
|
||||
}
|
||||
return $time_str;
|
||||
}
|
||||
|
||||
function week_day_humanize(int $week_day,bool $upper = false) : string
|
||||
{
|
||||
$week_days = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"];
|
||||
$week_day_string = "";
|
||||
if(in_array($week_day,range(0,6))){
|
||||
$week_day_string = $week_days[$week_day];
|
||||
}
|
||||
if($upper){
|
||||
$week_day_string = strtoupper($week_day_string);
|
||||
}
|
||||
return $week_day_string;
|
||||
}
|
||||
Reference in New Issue
Block a user