Comparing version 1.16.1 to 1.17.0
# Changelog | ||
## 1.17.0 | ||
* DateTime.min and DateTime.max throw if they get the wrong kind of arguments | ||
* Fixed throwOnInvalid logic for Interval | ||
* Added `DATETIME_MED_WITH_WEEKDAY` preset | ||
## 1.16.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "luxon", | ||
"version": "1.16.1", | ||
"version": "1.17.0", | ||
"description": "Immutable date wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Cambron", |
@@ -214,2 +214,4 @@ import * as Formats from "./formats.js"; | ||
return "LLL d, yyyy, h:mm:ss a"; | ||
case stringify(Formats.DATETIME_MED_WITH_WEEKDAY): | ||
return "EEE, d LLL yyyy, h:mm a"; | ||
case stringify(Formats.DATETIME_FULL_WITH_SECONDS): | ||
@@ -216,0 +218,0 @@ return "LLLL d, yyyy, h:mm:ss a"; |
@@ -138,2 +138,11 @@ /** | ||
export const DATETIME_MED_WITH_WEEKDAY = { | ||
year: n, | ||
month: s, | ||
day: n, | ||
weekday: s, | ||
hour: n, | ||
minute: d2 | ||
}; | ||
export const DATETIME_FULL = { | ||
@@ -140,0 +149,0 @@ year: n, |
@@ -12,7 +12,7 @@ import DateTime, { friendlyDateTime } from "./datetime.js"; | ||
if (!start || !start.isValid) { | ||
return new Invalid("missing or invalid start"); | ||
return Interval.invalid("missing or invalid start"); | ||
} else if (!end || !end.isValid) { | ||
return new Invalid("missing or invalid end"); | ||
return Interval.invalid("missing or invalid end"); | ||
} else if (end < start) { | ||
return new Invalid( | ||
return Interval.invalid( | ||
"end before start", | ||
@@ -91,7 +91,12 @@ `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}` | ||
return new Interval({ | ||
start: builtStart, | ||
end: builtEnd, | ||
invalid: validateStartEnd(builtStart, builtEnd) | ||
}); | ||
const validateError = validateStartEnd(builtStart, builtEnd); | ||
if (validateError == null) { | ||
return new Interval({ | ||
start: builtStart, | ||
end: builtEnd | ||
}); | ||
} else { | ||
return validateError; | ||
} | ||
} | ||
@@ -98,0 +103,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2818942
32718