Fungsi tanggal Statis Indonesia (CodeIgniter)

/* fungsi tanggal statis Indonesia
untuk pemanggilan gunakan
nama_controller::nama_function(date(‘Y-m-d’, strtotime($variabel_tanggal)))
Input_skp::format(date(‘Y-m-d’, strtotime($tanggal)))
/*
public static function format($date){
//bi = bulan_indonesia
$bi = explode(‘-‘, $date);
$bulan = array(
’01’ => ‘Januari’,
’02’ => ‘Februari’,
’03’ => ‘Maret’,
’04’ => ‘April’,
’05’ => ‘Mei’,
’06’ => ‘Juni’,
’07’ => ‘Juli’,
’08’ => ‘Agustus’,
’09’ => ‘September’,
’10’ => ‘Oktober’,
’11’ => ‘November’,
’12’ => ‘Desember’,
);
return $bi[‘2’]. ” ” . $bulan[$bi[1]] . ” ” .$bi[0];
}
// fungsi hari statis indonesia
public static function hari($date){
//hi = hari_indonesia
$hi = $date;
$hari = array(
‘Sun’ => ‘Minggu’,
‘Mon’ => ‘Senin’,
‘Tue’ => ‘Selasa’,
‘Wed’ => ‘Rabu’,
‘Thu’ => ‘Kamis’,
‘Fri’ => ‘Jumat’,
‘Sat’ => ‘Sabtu’
);
return $hari[$hi];
}

Recommended For You

About the Author: adyrhs

Leave a Reply

Your email address will not be published. Required fields are marked *