Skip to content

Commit

Permalink
Merge pull request #383 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain authored Apr 12, 2023
2 parents 59b27f0 + 495dba3 commit 53f68ca
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
10 changes: 7 additions & 3 deletions builds/spacetime.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* spencermountain/spacetime 7.4.2 Apache 2.0 */
/* spencermountain/spacetime 7.4.3 Apache 2.0 */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
Expand Down Expand Up @@ -2940,7 +2940,11 @@
if (n <= 0) {
n = 0;
} else if (n >= 365) {
n = 364;
if (isLeapYear(s.year())) {
n = 365;
} else {
n = 364;
}
}
s = s.startOf('year');
s = s.add(n, 'day');
Expand Down Expand Up @@ -4016,7 +4020,7 @@
};
var whereIts$1 = whereIts;

var version = '7.4.2';
var version = '7.4.3';

const main = (input, tz, options) => new Spacetime(input, tz, options);

Expand Down
2 changes: 1 addition & 1 deletion builds/spacetime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/spacetime.mjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ This project follows semVer, where:
-->

### 7.4.3 [April 2023]
- **[fix]** - support leap-years in setting dayOfYear() #382

### 7.4.2 [Mar 2023]
- **[change]** - Iran off of dst #379
- **[change]** - mexico off of dst #378
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": "spacetime",
"version": "7.4.2",
"version": "7.4.3",
"description": "figure-out dates across timezones",
"main": "src/index.js",
"unpkg": "builds/spacetime.min.js",
Expand Down
5 changes: 4 additions & 1 deletion scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ import spacetime from './src/index.js'

// spacetime.extend(require('./plugins/holiday'))

const assignmentDate = spacetime("2022-11-21T00:00:00.000Z").i18n({}).format("{day-short}, {month-short}, {date}, {year}");
let s = spacetime()
s = s.year(2020)
s = s.dayOfYear(366);
console.log(s.json())
2 changes: 1 addition & 1 deletion src/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '7.4.2'
export default '7.4.3'
6 changes: 5 additions & 1 deletion src/methods/set/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ const dayOfYear = function (s, n, goFwd) {
if (n <= 0) {
n = 0
} else if (n >= 365) {
n = 364
if (isLeapYear(s.year())) {
n = 365
} else {
n = 364
}
}
s = s.startOf('year')
s = s.add(n, 'day')
Expand Down

0 comments on commit 53f68ca

Please sign in to comment.