import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.MonthDay;
import java.time.Year;
import java.time.format.TextStyle;
import java.util.Locale;

public class MembuatLocalDate {
    public static void main(String[] args) {
        LocalDate peluncuran = LocalDate.of(2026, 1, 15);   // tahun, bulan (1-12), tanggal
        LocalDate dariTeks = LocalDate.parse("2026-01-15"); // format ISO-8601 bawaan

        System.out.println("peluncuran : " + peluncuran);
        System.out.println("dariTeks   : " + dariTeks);

        System.out.println("getYear()       : " + peluncuran.getYear());
        System.out.println("getMonthValue() : " + peluncuran.getMonthValue());
        System.out.println("getMonth()      : " + peluncuran.getMonth());
        System.out.println("getDayOfMonth() : " + peluncuran.getDayOfMonth());
        System.out.println("getDayOfWeek()  : " + peluncuran.getDayOfWeek());
        System.out.println("getDayOfYear()  : " + peluncuran.getDayOfYear());

        // Month dan DayOfWeek adalah enum: nama hari/bulan aman dari salah ketik.
        DayOfWeek hari = peluncuran.getDayOfWeek();
        Month bulan = peluncuran.getMonth();
        Locale id = Locale.forLanguageTag("id");
        System.out.println("nama hari  : " + hari.getDisplayName(TextStyle.FULL, id));
        System.out.println("nama bulan : " + bulan.getDisplayName(TextStyle.FULL, id));

        System.out.println("isLeapYear()    : " + peluncuran.isLeapYear());
        System.out.println("lengthOfMonth() : " + peluncuran.lengthOfMonth());
        System.out.println("lengthOfYear()  : " + peluncuran.lengthOfYear());

        // Tipe pendamping untuk kasus yang tidak butuh tanggal lengkap.
        System.out.println("MonthDay : " + MonthDay.of(Month.DECEMBER, 25));
        System.out.println("Year     : " + Year.of(2026) + ", kabisat? " + Year.isLeap(2026));
    }
}
