Skip to content

Releases: dmtrKovalenko/date-io

v2.6.1

17 Apr 09:05
Compare
Choose a tag to compare

Breaking changes

N/A

Fixes

v2.6.0

17 Apr 09:05
Compare
Choose a tag to compare

Breaking changes

N/A

Features

  • Introduce new getFormatHelperText method (#340)

Fixes

v2.5.1

02 Apr 15:08
Compare
Choose a tag to compare

This release is only fixing inclusivity rules of isWithinRange method.

v2.5.0

26 Mar 19:59
Compare
Choose a tag to compare

Breaking changes

N/A

Features

New functions:

  • isWithinRange: (date: TDate, range: [TDate, TDate]) => boolean
  • addMonths: (date: TDate, monthCount: number) => TDate

v2.4.0

11 Feb 14:47
Compare
Choose a tag to compare

Add 2 new functions:

  • startOfWeek(date: TDate): TDate - returns start of week
  • endOfWeek(date: TDate): TDate - returns end of week

v2.3.0

07 Feb 08:13
Compare
Choose a tag to compare

Changes

  • Add new toJsDate function converting lib object to native js date

v2.2.0

31 Jan 10:49
Compare
Choose a tag to compare

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

04 Jan 18:12
Compare
Choose a tag to compare

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 keys
  • formatByString allowes to use custom (mostly user-provided) format strings formatByString(value: TDate, formatString: string): string;

v1.3.13

05 Dec 14:07
Compare
Choose a tag to compare

Changelog

  • Add new methods: isSameMonth, isSameYear and isSameHour

v1.3.12

03 Dec 16:03
Compare
Choose a tag to compare

Dependency updates

We are changing the dependency strategy, so date-io will stop generating thousands of console peer dependencies warning. @LinusU