Skip to content

Commit

Permalink
v4.6.0
Browse files Browse the repository at this point in the history
* Validate time zone in quickDT prior to guessing offset (#1575)
* Use getPrototypeOf instead of __proto__ (#1592)
* Perf: Memoize digitsRegex (#1581)
* Add DateTime.buildFormatParser and DateTime.fromFormatParser (#1582)
* Perf: Use computed offset passed in DateTime constructor (#1576)
* Update interval.js doc per #742 (#1565)
* Added some JS doc for time zones (#1499)
* Fix cutoff year docs
* Perf: Cache ts offset guesses for quickDT (#1579)
  • Loading branch information
tonysamperi committed May 26, 2024
1 parent a009866 commit f52cfc6
Show file tree
Hide file tree
Showing 18 changed files with 1,422 additions and 1,011 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 4.6.0 (Luxon next 3.4.4)
* Validate time zone in quickDT prior to guessing offset (#1575)
* Use getPrototypeOf instead of __proto__ (#1592)
* Perf: Memoize digitsRegex (#1581)
* Add DateTime.buildFormatParser and DateTime.fromFormatParser (#1582)
* Perf: Use computed offset passed in DateTime constructor (#1576)
* Update interval.js doc per #742 (#1565)
* Added some JS doc for time zones (#1499)
* Fix cutoff year docs
* Perf: Cache ts offset guesses for quickDT (#1579)

## 4.5.2 (Luxon 3.4.4)
* Fixed Datetime docs for: fromJSDate, fromMillis, fromSeconds, diff (Closes [#9](https://github.com/tonysamperi/ts-luxon/issues/9))

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TS Luxon

[![MIT License][license-image]][license] [![Build Status][gh-actions-image]][gh-actions-url] [![NPM version][npm-version-image]][npm-url] [![Coverage Status][test-coverage-image]][test-coverage-url] ![PRs welcome][contributing-image]
[![Size](https://img.shields.io/bundlephobia/minzip/ts-luxon)](https://unpkg.com/ts-luxon@latest/bundles/ts-luxon.umd.min.js)
[![Size](https://img.shields.io/bundlephobia/minzip/ts-luxon)](https://unpkg.com/ts-luxon@latest/dist/ts-luxon.min.umd.js)

TS Luxon is a library for working with dates and times in Javscript and Typescript.

Expand Down Expand Up @@ -70,8 +70,8 @@ Pleas, read the CONTRIBUTING.md you can find in the master branch.
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg
[license]: LICENSE.md

[gh-actions-url]: https://github.com/tonysamperi/ts-luxon/actions?query=workflow%3A%22Docker+tests%22
[gh-actions-image]: https://github.com/tonysamperi/ts-luxon/workflows/Docker%20tests/badge.svg?branch=master
[gh-actions-url]: https://github.com/tonysamperi/ts-luxon/actions?query=workflow%3A%22Test%22
[gh-actions-image]: https://github.com/tonysamperi/ts-luxon/workflows/Test/badge.svg?branch=master

[npm-url]: https://npmjs.org/package/ts-luxon
[npm-version-image]: https://badge.fury.io/js/ts-luxon.svg
Expand Down
16 changes: 14 additions & 2 deletions benchmarks/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ function runDateTimeSuite() {
const suite = new Benchmark.Suite();

const dt = DateTime.now();
const formatParser = DateTime.buildFormatParser("yyyy/MM/dd HH:mm:ss.SSS");

suite
.add("DateTime.local", () => {
.add("DateTime.now", () => {
DateTime.now();
})
.add("DateTime.fromObject with locale", () => {
Expand All @@ -19,6 +20,9 @@ function runDateTimeSuite() {
.add("DateTime.local with numbers", () => {
DateTime.local(2017, 5, 15);
})
.add("DateTime.local with numbers and zone", () => {
DateTime.local(2017, 5, 15, 11, 7, 35, { zone: "America/New_York" });
})
.add("DateTime.fromISO", () => {
DateTime.fromISO("1982-05-25T09:10:11.445Z");
})
Expand All @@ -30,7 +34,15 @@ function runDateTimeSuite() {
})
.add("DateTime.fromFormat with zone", () => {
DateTime.fromFormat("1982/05/25 09:10:11.445", "yyyy/MM/dd HH:mm:ss.SSS", {
zone: "America/Los_Angeles",
zone: "America/Los_Angeles"
});
})
.add("DateTime.fromFormatParser", () => {
DateTime.fromFormatParser("1982/05/25 09:10:11.445", formatParser);
})
.add("DateTime.fromFormatParser with zone", () => {
DateTime.fromFormatParser("1982/05/25 09:10:11.445", formatParser, {
zone: "America/Los_Angeles"
});
})
.add("DateTime#setZone", () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-luxon",
"version": "4.5.2",
"version": "4.6.0",
"license": "MIT",
"description": "Typescript version of the \"Immutable date wrapper\"",
"author": "Tony Samperi",
Expand Down
Loading

0 comments on commit f52cfc6

Please sign in to comment.