diff --git a/docs/migration.md b/docs/migration.md index 3ea630c..72c4384 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -37,7 +37,7 @@ format(new Date(), 'ddd, MMM DD YYYY hh:mm A [GMT]Z', { timeZone: 'UTC' }); // => Fri, Jan 02 2015 07:14 AM GMT+0000 ``` -Additionally, since the `timezone` plugin has been integrated into the main library, the `formatTZ` function has been deprecated. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). +Additionally, since the `timezone` plugin has been integrated into the main library, the `formatTZ` function is now obsolete. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). ```typescript import { format } from 'date-and-time'; @@ -58,7 +58,7 @@ parse('11:14:05 PM', 'h:mm:ss A', { timeZone: 'UTC' }); // => Jan 02 1970 23:14:05 GMT+0000 ``` -Additionally, since the `timezone` plugin has been integrated into the main library, the `parseTZ` function has been deprecated. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). +Additionally, since the `timezone` plugin has been integrated into the main library, the `parseTZ` function is now obsolete. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). ```typescript import { parse } from 'date-and-time'; @@ -99,7 +99,7 @@ Additionally, the `PreparseResult` object returned by the `preparse` function ha ### isValid -The following usage that takes `PreparseResult` as an argument has been deprecated. +The following usage that takes `PreparseResult` as an argument is now obsolete. ```typescript import { isValid, preparse } from 'date-and-time'; @@ -114,7 +114,7 @@ Other changes are the same as for the `parse` function. ### transform -The fourth argument has been changed from `boolean` to `FormatterOptions`. With `FormatterOptions`, you can now specify timezone and locale settings. Additionally, `ParserOptions` has been added as a parameter before `FormatterOptions`. Since the `timezone` plugin has been integrated into the main library, the `transformTZ` function has been deprecated. +The fourth argument has been changed from `boolean` to `FormatterOptions`. With `FormatterOptions`, you can now specify timezone and locale settings. Additionally, `ParserOptions` has been added as a parameter before `FormatterOptions`. Since the `timezone` plugin has been integrated into the main library, the `transformTZ` function is now obsolete. ```typescript import { transform } from 'date-and-time'; @@ -147,7 +147,7 @@ addYears(now, 1, 'UTC'); // => Mar 11 2025 01:00:00 GMT+0000 ``` -Additionally, since the `timezone` plugin has been integrated into the main library, the `addYearsTZ` function has been deprecated. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). +Additionally, since the `timezone` plugin has been integrated into the main library, the `addYearsTZ` function is now obsolete. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). ```typescript import Los_Angeles from 'date-and-time/timezones/America/Los_Angeles'; @@ -187,7 +187,7 @@ subtract(yesterday, today).toMilliseconds().value; // => 86400000 ### timeSpan -The `timespan` plugin has been deprecated as it has been integrated into the main library's `subtract` function. Please note that the argument order of the `subtract` function has changed. You can achieve the same output as before as follows: +The `timespan` plugin is now obsolete as it has been integrated into the main library's `subtract` function. Please note that the argument order of the `subtract` function has changed. You can achieve the same output as before as follows: ```typescript import { subtract } from 'date-and-time'; @@ -219,7 +219,7 @@ format(new Date(), 'dddd, D [de] MMMM [de] YYYY, h:mm aa [GMT]ZZ', { locale: es ## Plugins -The following plugins have been deprecated as they have been integrated into the main library: +The following plugins are now obsolete as they have been integrated into the main library: - `meridiem` - `timespan` diff --git a/docs/plugins.md b/docs/plugins.md index 3aae836..d5e6e19 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -8,7 +8,7 @@ ```typescript import { format } from 'date-and-time'; -import foobar from 'date-and-time/plugins/foobar'; +import { formatter as foobar } from 'date-and-time/plugins/foobar'; format(new Date(), 'ddd, MMM DD YYYY', { plugins: [foobar] }); ``` @@ -19,7 +19,7 @@ format(new Date(), 'ddd, MMM DD YYYY', { plugins: [foobar] }); const { format } = require('date-and-time'); const foobar = require('date-and-time/plugins/foobar'); -format(new Date(), 'ddd, MMM DD YYYY', { plugins: [foobar] }); +format(new Date(), 'ddd, MMM DD YYYY', { plugins: [foobar.formatter] }); ``` ## Plugin List @@ -39,7 +39,7 @@ You can add tokens to the `Parser` to read day of the week. Since day of the wee ```typescript import { parse } from 'date-and-time'; -import day_of_week from 'date-and-time/plugins/day_of_week'; +import { parser as day_of_week } from 'date-and-time/plugins/day_of_week'; parse( 'Thursday, March 05, 2020', 'dddd, MMMM, D YYYY', @@ -67,7 +67,7 @@ You can add tokens to the `Parser` to read microseconds. Since the precision of ```typescript import { parse } from 'date-and-time'; -import microsecond from 'date-and-time/plugins/microsecond'; +import { parser as microsecond } from 'date-and-time/plugins/microsecond'; parse('12:34:56.123456', 'HH:mm:ss.SSSSSS', { plugins: [microsecond] }); parse('12:34:56 123.456', 'HH:mm:ss SSS.fff', { plugins: [microsecond] }); @@ -93,8 +93,8 @@ You can add tokens to the `Parser` to read nanoseconds. Since the precision of J ```typescript import { parse } from 'date-and-time'; -import microsecond from 'date-and-time/plugins/microsecond'; -import nanosecond from 'date-and-time/plugins/nanosecond'; +import { parser as microsecond } from 'date-and-time/plugins/microsecond'; +import { parser as nanosecond } from 'date-and-time/plugins/nanosecond'; parse( '12:34:56.123456789', @@ -124,7 +124,7 @@ You can add tokens to the `Formatter` and `Parser` to output or read ordinal rep ```typescript import { format } from 'date-and-time'; -import ordinal from 'date-and-time/plugins/ordinal'; +import { formatter as ordinal } from 'date-and-time/plugins/ordinal'; format(new Date(), 'MMM DDD YYYY', { plugins: [ordinal] }); // => Jan 1st 2019 @@ -138,7 +138,7 @@ format(new Date(), 'MMM DDD YYYY', { plugins: [ordinal] }); ```typescript import { parse } from 'date-and-time'; -import ordinal from 'date-and-time/plugins/ordinal'; +import { parser as ordinal } from 'date-and-time/plugins/ordinal'; parse('Jan 1st 2019', 'MMM DDD YYYY', { plugins: [ordinal] }); ``` @@ -161,7 +161,7 @@ You can add tokens to the `Parser` to read 2-digit years. This token identifies ```typescript import { parse } from 'date-and-time'; -import two_digit_year from 'date-and-time/plugins/two-digit-year'; +import { parser as two_digit_year } from 'date-and-time/plugins/two-digit-year'; parse('Dec 25 69', 'MMM DD YY', { plugins: [two_digit_year] }); // => Dec 25 2069 @@ -185,7 +185,7 @@ You can add tokens to the `Formatter` to output timezone names. These timezone n ```typescript import { parse } from 'date-and-time'; -import zonename from 'date-and-time/plugins/zonename'; +import { formatter as zonename } from 'date-and-time/plugins/zonename'; import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; format(