Releases: dmtrKovalenko/date-io
Releases · dmtrKovalenko/date-io
v2.6.1
v2.6.0
Breaking changes
N/A
Features
- Introduce new getFormatHelperText method (#340)
Fixes
- [docs] Improve documentation and fix a typo (#328) @winestone
- Include seconds in mergeDateAndTime method (#341) @dmtrKovalenko
v2.5.1
This release is only fixing inclusivity rules of isWithinRange
method.
v2.5.0
Breaking changes
N/A
Features
New functions:
isWithinRange: (date: TDate, range: [TDate, TDate]) => boolean
addMonths: (date: TDate, monthCount: number) => TDate
v2.4.0
Add 2 new functions:
startOfWeek(date: TDate): TDate
- returns start of weekendOfWeek(date: TDate): TDate
- returns end of week
v2.3.0
Changes
- Add new
toJsDate
function converting lib object to native js date
v2.2.0
Localization improvements release
We have changed the formats tokens to use localized formats tokens everywhere possible. Also introduced several new methods and formats
List of new methods added:
- is12HourCycleInCurrentLocale(): boolean - determine is 12 hours cycle and ampm used in current locale
- getCurrentLocaleCode - get locale code
v2.0.0
Major upgrade
Do not update if you are using @material-ui/pickers v3
Breaking changes
- Remove all static format fields like
dateTimeFormat
- Introduce new object for cross utils formatting. It is overridable via constructor
formats
prop and provides easy localization formatting
export interface DateIOFormats {
/** Full date, useful for accessibility @example "2019, January 1st" */
fullDate: string;
/** Day format string extremely required to localize @example "Wed, Jan 1st" for US, "January 1st" for Europe */
normalDate: string;
/** Shorter day format @example "Jan 1st" */
shortDate: string;
/** Year format string @example "2019" */
year: string;
/** Month format string @example "January" */
month: string;
/** Short month format string @example "Jan" */
monthShort: string;
/** Short month format string @example "January 2018" */
monthAndYear: string;
/** Month with date format string @example "January 1st" */
monthAndDate: string;
/** Day format string @example "12" */
dayOfMonth: string;
/** Full time format string @example "11:44 PM" */
fullTime12h: string;
/** Full time format string @example "23:59" */
fullTime24h: string;
/** Hours format string @example "11" */
hours12h: string;
/** Hours format string @example "23" */
hours24h: string;
/** Minutes format string @example "59" */
minutes: string;
/** Seconds format string @example "59" */
seconds: string;
/** Date & Time format string @example "2018, Jan 1st 11:44 PM" */
fullDateTime12h: string;
/** Date & Time format string @example "2018, Jan 1st 23:44" */
fullDateTime24h: string;
/** Keyboard input friendly date format @example "2019/01/01" */
keyboardDate: string;
/** Keyboard input friendly date/time 12h format @example "2019/01/01 23:44" */
keyboardDateTime12h: string;
/** Keyboard input friendly date/time 24h format @example "2019/01/01 11:44 PM" */
keyboardDateTime24h: string;
}
format
method now has signature(date: TDate, formatKey: keyof IDateIOFormat) => string
in order to simplify formatting using new format keysformatByString
allowes to use custom (mostly user-provided) format stringsformatByString(value: TDate, formatString: string): string;
v1.3.13
Changelog
- Add new methods: isSameMonth, isSameYear and isSameHour