Releases: meduzen/datetime-attribute
Releases · meduzen/datetime-attribute
1.4.0
Note
This version was published on NPM almost 6 months after the release tag was created on GitHub. Yes, I forgot.
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 per.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 standardizedTemporal
API. - Update ESLint config to group
import
statements by source. - Change TypeScript
target
toESNExt
. - Rename some internals.
- Remove test files from published package.
1.4.0-rc.0
This is a test release to see how typing resolution is working when installing the package from a remote registry.
Changes: see 1.4.0.
1.3.4
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 was2021-W53
instead of2020-W53
.
Improved
- Improve type definitions where
?
andundefined
are redundant by removingundefined
:- for some signatures of optional parameters from
datetime(date?: Date | undefined
todatetime(date?: Date
- for some optional properties from
{ w?: number | undefined }
to{ w?: number }
- for some signatures of optional parameters from
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
andsetTzConfig
: it was possible to omit theirseparator
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.
1.3.3
Fixed
- Fix
.js
file extension missing in animport
statement when trying toimport { 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
totest:types
. - Update tooling for Node 20.
- Configure the dependencies update automation to group them by categories.
- Monitor package size on pull request.
1.3.2
Improved
- Shorten
daysBetween()
andDateTime
footprint by a couple of bytes.
Warning
If not transpiled, DateTime
now requires support for class
fields (Safari 14.0).
Under the hood
- Replace NPM by pnpm.
1.3.2.-0
1.3.1
1.3.0
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 links to bundles sizes.
Under the hood
- Update development dependencies.
- Update
package.json
description and keywords fields. - Update GitHub actions.
1.2.0
New
- Add
setTzSeparator()
to customize the hours-minutes separator of timezone offsets. - Add a Precision type for the
precision
parameter ofdatetime
,datetimeTz
andDateTime.to
, and a subset of this new type forutc
. It autocompletes the parameter (in modern code editors) with the available keywords.
Under the hood
- Improve types generation.
1.1.0
New
- Add a
DateTime()
class extending the nativeDate
object. Available methods:getWeek()
,setWeek()
andto()
.
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.