Skip to content

Latest commit

 

History

History
312 lines (170 loc) · 10.8 KB

CHANGELOG.md

File metadata and controls

312 lines (170 loc) · 10.8 KB

Changelog

This project adheres to Semantic Versioning.

Unreleased

Nothing for now.

Compare with last published version.

v1.4.0 (2024-04-21)

Compare with last published version.

New

  • Add setTzInRealWorldRange() allowing to shift timezones to be inside the real-world (IANA) range.
  • Add setTzConfig() to set the timezone related configuration: pass it an object to set the timezone separator and enforce the IANA range at the same time.

Improved

  • Improve multiple typing resolutions: previously, 1 .d.ts file were generated by .js file, preserving the initial folder structure. In both plain JavaScript and TypeScript environments, this was leading to quirks like:
    • types exported from subpath instead of root
    • unexported functions being exported as types

Despite these, documented functions were properly exposed but global typing discoverability was a mess. See the comment in the related pull requests for more. This is now fixed by cleaning and combining all .d.ts files into one thanks to dts-bundle-generator.

Documentation

  • Fix documentation examples for tzOffset.
  • Rephrase some parts.

Under the hood

  • And add more tests for tzOffset in order to strenghten. This will be useful for the work around the standardized Temporal API.
  • Update ESLint config to group import statements by source.
  • Change TypeScript target to ESNExt.
  • Rename some internals.
  • Remove test files from published package.

v1.3.4 (2024-04-18)

Compare with previous version.

Fixed

  • Fix incorrect year for datetime(date, 'week') when the week started the previous year. For example, 2021-01-01 is a Friday and its week belongs to 2020 (as per spec). In that case, the output was 2021-W53 instead of 2020-W53.

Improved

  • Improve type definitions where ? and undefined are redundant by removing undefined:
    • for some signatures of optional parameters from datetime(date?: Date | undefined to datetime(date?: Date
    • for some optional properties from { w?: number | undefined } to { w?: number }

Documentation

  • Use brotli compression instead of gzip one to express the module size.

Under the hood

  • Enforce type definitions for optional properties of the internal config functions setConfig and setTzConfig: it was possible to omit their separator property, it’s not anymore.
  • Upgrade ESLint from 8 to 9 and lint tests using eslint-plugin-vitest.
  • Split test file and move tests closer to the code.

v1.3.3 (2024-02-23)

Compare with previous version.

Fixed

  • Fix .js file extension missing in an import statement when trying to import { datetime }, which worked in some bundlers but could fail in others or when not using any bundler. This issue was introduced in version 1.3.0.

Documentation

  • Fix typos.

Under the hood

  • The NPM command to test types has been changed from test-types to test:types.
  • Update tooling for Node 20.
  • Configure the dependencies update automation to group them by categories.
  • Monitor package size on pull request.

v1.3.2 (2023-08-05)

Compare with previous version.

Improved

  • Shorten daysBetween() and DateTime footprint by a couple of bytes.

Warning

When not transpiled, DateTime now requires support for class fields (Safari 14.0).

Under the hood

  • Replace NPM by pnpm.

v1.3.1 (2023-02-10)

Compare with previous version.

Fixed

  • Typo (grammar) in types documentation.

Under the hood

  • Add code of conduct, issue template, contributing guidelines, code analysis, dependabot, CodeQL.
  • Replace Jest by Vitest.

v1.3.0 (2022-10-10)

Compare with previous version.

New

  • Support years with more then 4 digits (12345-01-01).
  • Support years prior to year 1 (-0051-01-01).
  • Add setTimeSeparator() to customize the separator between date and time.

Fixed

  • Missing zero-padding in front of years with less then 4 digits (0537-01-01).

Documentation

  • Update bundle sizes and related links.
  • Fix links in this changelog.

Under the hood

  • Update development dependencies.
  • Update package.json description and keywords fields.
  • Update GitHub actions.

v1.2.0 (2022-03-10)

Compare with previous.

New

  • Add setTzSeparator() to customize the hours-minutes separator of timezone offsets.
  • Add a Precision type for the precision parameter of datetime, datetimeTz and DateTime.to, and a subset of this new type for utc. It autocompletes the parameter (in modern code editors) with the available keywords.

Under the hood

  • Improve types generation.

v1.1.0 (2021-11-01)

Compare with previous.

New

  • Add a DateTime() class extending the native Date object. Available methods: getWeek(), setWeek() and to().

Fixed

  • Allow datetimeTz() without parameters. Before, the date was mandatory.
  • Improve types declaration.

Under the hood

  • Add a NPM script to generate types.
  • Update ESLint rules.

v1.0.0 (2021-10-30) 🎉

Compare with previous version.

The usage remains the same as in the previous version.

v0.7.0 (2021-07-11)

Compare with previous version.

Changed

  • Forbid null as valid duration() argument: duration(null) now throws an error.

New

  • Add types for TypeScript users.

Fixed

  • Fix zero-seconds duration() returning null instead of PT0S.

v0.6.0 (2021-07-10)

Compare with previous version.

Changed

New

  • Add utc() as a shortcut to datetime(myDateObject, 'datetime utc').

Under the hood

  • The project now has an ESLint configuration.

v0.5.1 (2021-07-05)

Compare with previous version.

Fixed

The day number in datetime() and datetimeTz() was wrong before the 10th of the month. For example, the 5th of July became 2021-07-5T instead of 2021-07-5T.

v0.5.0 (2021-05-02)

Compare with previous version.

Changed

  • tzOffset() and datetimeTz() now adjust the timezone to fit the spec boundaries (from -23:59 to +23:59). There was no limits before.

New

  • tzOffset() now accepts a third parameter. When set to true, it enforce the provided timezone to stay in real-world boundaries (from -12:00 to +14:00).
  • This also applies to datetimeTz(), which now accepts a fifth parameter to be on par with how tzOffset() works.

v0.4.2 (2021-05-02)

Compare with previous version.

New

  • datetimeDuration() now accepts a second parameter. When set to false, overflow units won’t be converted anymore.

Documentation

  • Add a table of contents, summary usage and package size.
  • Improve various parts of the documentation and the release notes.

v0.4.1 (2021-04-03)

Compare with previous version.

New

  • Add datetimeTz() to indicate that a datetime attribute belongs to the specified timezone offset.

Changed

  • Rename datetimeTz() to tzOffset()

v0.3.0 (2021-04-02)

Compare with previous version.

Changed

  • datetime(): local and global precision keywords are now datetime and utc.

New

  • Add datetime() missing global precisions.

v0.2.1 (2021-04-02)

Compare with previous version.

Changed

  • datetime() without parameter is now accepted: instead of throwing an error it defaults to now with the default precision (YYYY-mm-dd).

New

Documentation

  • Rewrite most of the documentation.

v0.1.7 (2021-04-01)

Compare with previous version.

Improved

  • Shorten datetimeDuration() footprint by a couple of bytes.

Documentation

  • Fix duration datetime output in documentation.

v0.1.6 (2021-03-21)

Compare with previous version.

Improved

  • Rewrite how datetime() works to shorten its footprint.

v0.1.5 (2021-03-14)

Compare with previous version.

New

  • Mark the package as being side effects free.

v0.1.4 (2021-03-14)

First published version.