package net.ranides.assira.time2;

import lombok.experimental.UtilityClass;

import java.time.ZoneId;
import java.time.ZonedDateTime;

@UtilityClass
public class DateTimeLiteral {

    public static final ZonedDateTime MIN = datetime(1900, 1, 1, 0, 0, 0);

    public static final ZonedDateTime MAX = datetime(4000, 1, 1, 0, 0, 0);

    public static ZonedTime time(int h, int m, int s) {
        return ZonedTime.of(datetime(1900, 1, 1, 0, 0));
    }

    public static ZonedDate date(int y, int m, int d) {
        return ZonedDate.of(datetime(y, m, d, 0, 0));
    }

    public static ZonedDateTime datetime(int y, int m, int d, int H, int M) {
        return datetime(y, m, d, H, M, 0);
    }

    public static ZonedDateTime datetime(int y, int m, int d, int H, int M, int S) {
        return ZonedDateTime.of(y, m, d, H, M, S, 0, ZoneId.systemDefault());
    }

    @ZoneExplicit
    public static ZonedTime timeUtc(int h, int m, int s) {
        return ZonedTime.of(datetimeUtc(1900, 1, 1, 0, 0));
    }

    @ZoneExplicit
    public static ZonedDate dateUtc(int y, int m, int d) {
        return ZonedDate.of(datetimeUtc(y, m, d, 0, 0));
    }

    @ZoneExplicit
    public static ZonedDateTime datetimeUtc(int y, int m, int d, int H, int M) {
        return datetimeUtc(y, m, d, H, M, 0);
    }

    @ZoneExplicit
    public static ZonedDateTime datetimeUtc(int y, int m, int d, int H, int M, int S) {
        return ZonedDateTime.of(y, m, d, H, M, S, 0, DateTimeUtils.ZONE_UTC);
    }
}
