diff --git a/app/Controllers/Admin/GenerateLaporan.php b/app/Controllers/Admin/GenerateLaporan.php index 11a9acd..3e32fd8 100644 --- a/app/Controllers/Admin/GenerateLaporan.php +++ b/app/Controllers/Admin/GenerateLaporan.php @@ -85,7 +85,7 @@ public function generateLaporanSiswa() $bulan = $this->request->getVar('tanggalSiswa'); // hari pertama dalam 1 bulan - $begin = new DateTime($bulan); + $begin = new Time($bulan, locale: 'id'); // tanggal terakhir dalam 1 bulan $end = (new DateTime($begin->format('Y-m-t')))->modify('+1 day'); // interval 1 hari @@ -107,7 +107,7 @@ public function generateLaporanSiswa() $absenByTanggal['lewat'] = $lewat; array_push($dataAbsen, $absenByTanggal); - array_push($arrayTanggal, $value); + array_push($arrayTanggal, Time::createFromInstance($value, locale: 'id')); } } @@ -121,7 +121,7 @@ public function generateLaporanSiswa() $data = [ 'tanggal' => $arrayTanggal, - 'bulan' => $begin->format('F'), + 'bulan' => $begin->toLocalizedString('MMMM'), 'listAbsen' => $dataAbsen, 'listSiswa' => $siswa, 'jumlahSiswa' => [ @@ -138,7 +138,7 @@ public function generateLaporanSiswa() $this->response->setHeader('Content-type', 'application/vnd.ms-word'); $this->response->setHeader( 'Content-Disposition', - 'attachment;Filename=laporan_absen_' . $kelas['kelas'] . " " . $kelas['jurusan'] . '_' . $begin->format('F-Y') . '.doc' + 'attachment;Filename=laporan_absen_' . $kelas['kelas'] . " " . $kelas['jurusan'] . '_' . $begin->toLocalizedString('MMMM-Y') . '.doc' ); return view('admin/generate-laporan/laporan-siswa', $data); @@ -163,7 +163,7 @@ public function generateLaporanGuru() $bulan = $this->request->getVar('tanggalGuru'); // hari pertama dalam 1 bulan - $begin = new DateTime($bulan); + $begin = new Time($bulan, locale: 'id'); // tanggal terakhir dalam 1 bulan $end = (new DateTime($begin->format('Y-m-t')))->modify('+1 day'); // interval 1 hari @@ -185,7 +185,7 @@ public function generateLaporanGuru() $absenByTanggal['lewat'] = $lewat; array_push($dataAbsen, $absenByTanggal); - array_push($arrayTanggal, $value); + array_push($arrayTanggal, Time::createFromInstance($value, locale: 'id')); } } @@ -199,7 +199,7 @@ public function generateLaporanGuru() $data = [ 'tanggal' => $arrayTanggal, - 'bulan' => $begin->format('F'), + 'bulan' => $begin->toLocalizedString('MMMM'), 'listAbsen' => $dataAbsen, 'listGuru' => $guru, 'jumlahGuru' => [ @@ -215,7 +215,7 @@ public function generateLaporanGuru() $this->response->setHeader('Content-type', 'application/vnd.ms-word'); $this->response->setHeader( 'Content-Disposition', - 'attachment;Filename=laporan_absen_guru_' . $begin->format('F-Y') . '.doc' + 'attachment;Filename=laporan_absen_guru_' . $begin->toLocalizedString('MMMM-Y') . '.doc' ); return view('admin/generate-laporan/laporan-guru', $data); diff --git a/app/Views/admin/generate-laporan/laporan-guru.php b/app/Views/admin/generate-laporan/laporan-guru.php index e1405d4..e0261a6 100644 --- a/app/Views/admin/generate-laporan/laporan-guru.php +++ b/app/Views/admin/generate-laporan/laporan-guru.php @@ -25,7 +25,7 @@