date-io

Abstraction over common javascript date management libraries

MIT License

Downloads
22.1M
Stars
698
Committers
46

Bot releases are hidden (Show)

date-io - v2.6.0

Published by dmtrKovalenko over 4 years ago

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
date-io - v2.5.1

Published by dmtrKovalenko over 4 years ago

This release is only fixing inclusivity rules of isWithinRange method.

date-io - v2.5.0

Published by dmtrKovalenko over 4 years ago

Breaking changes

N/A

Features

New functions:

  • isWithinRange: (date: TDate, range: [TDate, TDate]) => boolean
  • addMonths: (date: TDate, monthCount: number) => TDate
date-io - v2.4.0

Published by dmtrKovalenko over 4 years ago

Add 2 new functions:

  • startOfWeek(date: TDate): TDate - returns start of week
  • endOfWeek(date: TDate): TDate - returns end of week
date-io - v2.3.0

Published by dmtrKovalenko over 4 years ago

Changes

  • Add new toJsDate function converting lib object to native js date
date-io - v2.2.0

Published by dmtrKovalenko over 4 years ago

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
date-io - v2.0.0

Published by dmtrKovalenko almost 5 years ago

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;
date-io - v1.3.13

Published by dmtrKovalenko almost 5 years ago

Changelog

  • Add new methods: isSameMonth, isSameYear and isSameHour
date-io - v1.3.12

Published by dmtrKovalenko almost 5 years ago

Dependency updates

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

date-io - v1.3.11

Published by dmtrKovalenko about 5 years ago

Changelog:

  • Remove some unused packages from dependecies (lerna, typescript)
  • Improve moment localization. Right now it will automatically apply first day of week depending on the locale
  • Improve typing for dayjs utils
date-io - v1.3.9

Published by dmtrKovalenko about 5 years ago

This is a patch release with the following updates:

  • Update to date-fns beta
  • Added ability to override date-fns options by overriding only one format method
date-io - v3.1.8

Published by dmtrKovalenko over 5 years ago

🎉 Published @date-io/hijiri adapter that wrapping up moment-hijiri

date-io - v1.3.7

Published by dmtrKovalenko over 5 years ago

Local localization :)

This release comes with changed a policy of locale passing to the inner lib instance. It will pass the locale down to the moment or dayjs on each invocation, instead of relying on global locale

date-io - v1.3.1 HotFix release 😭

Published by dmtrKovalenko over 5 years ago

Make imports in @date-io/type to be inside declaration block

date-io - v1.3.0

Published by dmtrKovalenko over 5 years ago

This release adds better support of typescript typings.
Added new ts-only module @date-io/type that contains type definition for particular date library.

date-io - v1.2.0

Published by dmtrKovalenko over 5 years ago

Fixes / improvements

  • Update luxon formats to correct standalone and format versions (#37) @pomadin
  • Make possible to pass global dayjs instance similar to moment (#39) @dmtrKovalenko

Make sure that moment constructor option is deprecated since the current release. Use instance instead.

date-io - v1.1.0

Published by dmtrKovalenko over 5 years ago

📅 Support of dayjs 📅

date-io - v1.0.4

Published by dmtrKovalenko over 5 years ago

Fix of luxon's isValid crashing when passing null | undefined

date-io - v1.0.2

Published by dmtrKovalenko over 5 years ago

Here what's changed:

Breaking change

🚫

Features

  • Add new repository for moment-jalaali adoption.
  • Add new functions: yearFormat, yearMonthFormat, setMonth, getMonthArray, getMonthText (#17) @OleksiiKukuruza
  • Update to the [email protected] (#23)
  • Fix isEqual not accepting nulls in luxon utils (#18)
  • Add typescript usage note for moment users to README.md
date-io - v1.0.1

Published by dmtrKovalenko almost 6 years ago

🎉 Stable release 🎉
We are now more stable and we have 100% test coverage

Breaking changes:

  • Rename getStartOfMonth to startOfMonth for better consistency

Fixes

  • [luxon] Fix all isBefore* methods
  • [luxon] Fix isAfterDay