Update CatatanPerkembanganPasienTerintegrasiService

Perbaikan panjang periode pencarian tanggal daftar hadir dpjp jika bulan berjalan menggunakan format tahun dan bulan
This commit is contained in:
Salman Manoe 2022-02-01 16:21:00 +07:00
parent 1fedc79d8f
commit ef1b707415

View File

@ -8,6 +8,7 @@ import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.YearMonth;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
@ -259,7 +260,8 @@ public class CatatanPerkembanganPasienTerintegrasiServiceImpl extends BaseVoServ
String strStartDate;
String strEndDate;
LocalDate localMonth = Instant.ofEpochMilli(periode).atZone(ZoneId.systemDefault()).toLocalDate();
if (LocalDate.now().getMonthValue() == localMonth.getMonthValue()) {
YearMonth yearMonth = YearMonth.from(localMonth);
if (YearMonth.now() == yearMonth) {
strStartDate = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).format(dtf);
strEndDate = LocalDate.now().format(dtf);
} else {