Skip to content

Commit

Permalink
Merge branch 'moment:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nodify-at authored Aug 4, 2024
2 parents 456325e + a7f126a commit 05c075b
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# 3.5.0 (2024-08-03)

- Various performance improvements
- throwOnInvalid causes the constructor to throw if the year is invalid

# 3.4.4 (2023-11-12)

- Localized week support (#1454)
Expand Down
62 changes: 36 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "luxon",
"version": "3.4.4",
"version": "3.5.0",
"description": "Immutable date wrapper",
"author": "Isaac Cambron",
"keywords": [
Expand Down
8 changes: 4 additions & 4 deletions src/datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,7 @@ export default class DateTime {
* @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'
* @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'
* @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'
* @return {string}
* @return {string|null}
*/
toISO({
format = "extended",
Expand All @@ -1850,7 +1850,7 @@ export default class DateTime {
* @param {string} [opts.format='extended'] - choose between the basic and extended format
* @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'
* @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'
* @return {string}
* @return {string|null}
*/
toISODate({ format = "extended" } = {}) {
if (!this.isValid) {
Expand Down Expand Up @@ -1935,7 +1935,7 @@ export default class DateTime {
/**
* Returns a string representation of this DateTime appropriate for use in SQL Date
* @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'
* @return {string}
* @return {string|null}
*/
toSQLDate() {
if (!this.isValid) {
Expand Down Expand Up @@ -2137,7 +2137,7 @@ export default class DateTime {
/**
* Return an Interval spanning between this DateTime and another DateTime
* @param {DateTime} otherDateTime - the other end point of the Interval
* @return {Interval}
* @return {Interval|DateTime}
*/
until(otherDateTime) {
return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
Expand Down
8 changes: 8 additions & 0 deletions src/interval.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ export default class Interval {
return this.isValid ? this.e : null;
}

/**
* Returns the last DateTime included in the interval (since end is not part of the interval)
* @type {DateTime}
*/
get lastDateTime() {
return this.isValid ? (this.e ? this.e.minus(1) : null) : null;
}

/**
* Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.
* @type {boolean}
Expand Down
2 changes: 1 addition & 1 deletion src/luxon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import InvalidZone from "./zones/invalidZone.js";
import SystemZone from "./zones/systemZone.js";
import Settings from "./settings.js";

const VERSION = "3.4.4";
const VERSION = "3.5.0";

export {
VERSION,
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"type": "module",
"version": "3.4.4"
"version": "3.5.0"
}

0 comments on commit 05c075b

Please sign in to comment.