/** * Calendar arithmetic on civil dates: no zone, no instant, no clock. * * A civil date is a year, a month and a day as a person writes them. Turning * one into an instant needs a zone and lives in `zone.ts`; everything here is * counting days, and it is separated for that reason: the day number of the * fifteenth of March is the same fact in every zone on earth, and mixing the * two questions is how a calendar ends up right in one half of the year. * * The day number is days since 1970-01-01, positive after it and negative * before. The conversion both ways is the standard proleptic Gregorian one, * shifted so the leap day falls at the end of an internal year that starts in * March: that is what removes the special case for February and makes the * inverse exact rather than iterative. */ /** A date and a time of day as a person writes them, with no zone attached. */ export interface Civil { readonly year: number; /** 1 to 12. */ readonly month: number; /** 1 to 31. */ readonly day: number; readonly hour: number; readonly minute: number; readonly second: number; } /** Days from 1970-01-01 to this civil date. */ export declare function dayNumber(year: number, month: number, day: number): number; /** The civil date a day number names, the exact inverse of `dayNumber`. */ export declare function dateOfDay(days: number): { year: number; month: number; day: number; }; /** * The day of the week, 1 for Monday through 7 for Sunday. * * Monday is 1 so that a weekday test reads `date.dayOfWeek(time) <= 5` and a * trading week is a contiguous range, which `stdlib.md` section 12.2 states and * gives the reason for. */ export declare function weekdayOfDay(days: number): number; /** The day of the year, 1 to 366. */ export declare function dayOfYearOf(year: number, month: number, day: number): number; /** * The week number, weeks starting Monday. * * Read as the ISO 8601 week: week 1 is the week holding the year's first * Thursday, so a week that straddles the new year belongs to the year holding * most of it and no year ever has a week 0. `stdlib.md` section 12.2 fixes the * Monday start and this settles the rest of it, because the alternatives differ * by a whole week at the turn of every year and a reader has no way to tell * which one a chart drew. */ export declare function weekOfYearOf(year: number, month: number, day: number): number; //# sourceMappingURL=civil.d.ts.map