-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from smallwins/dev
Dev
- Loading branch information
Showing
18 changed files
with
193 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
.DS_Store | ||
.jshintrc | ||
.env | ||
immutable.js | ||
spacetime.js | ||
node_modules/ | ||
.nyc_output | ||
npm-debug.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
const ist = require('./immutable') | ||
const spacetime = require('./src/index') | ||
|
||
let day0 = ist.now() | ||
console.log(day0.format('nice')) | ||
console.log(day0.add(2, 'days').format('nice')) | ||
console.log(day0.subtract(1, 'days').format('nice')) | ||
// const s = spacetime(1517509494000, 'UTC') | ||
// s.timezones = { | ||
// 'UTC/fun': { | ||
// o: 9, | ||
// h: 'n' | ||
// } | ||
// } | ||
// s.goto('UTC/fun') | ||
// s.debug() | ||
|
||
// let s = spacetime([1970, 1, 1], 'UTC') | ||
// console.log(new Date(s.epoch * 1000)) | ||
// | ||
// s = spacetime([2054, 10, 1], 'UTC') | ||
// console.log(new Date(s.epoch / 1000)) | ||
|
||
// new handy warning in [email protected] | ||
// Fun fact: we're only subject-to these 'off-by-thousand' date errors between Sept 2001 and Jan 2057. | ||
|
||
console.time('test') | ||
for (let i = 0; i < 10000; i += 1) { | ||
let r = parseInt(Math.random() * 5, 10) | ||
let s = spacetime([1980 + r, r, 20 + r], 'UTC') | ||
s.format('date') | ||
} | ||
console.timeEnd('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* spacetime v3.0.0 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.