-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
3,220 additions
and
2,931 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
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 +1 @@ | ||
module.exports = { singleQuote: true, printWidth: 100 }; | ||
module.exports = { printWidth: 100 }; |
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,47 +1,47 @@ | ||
/* eslint import/no-extraneous-dependencies: off */ | ||
/* eslint no-console: off */ | ||
import Benchmark from 'benchmark'; | ||
import DateTime from '../src/datetime'; | ||
import Benchmark from "benchmark"; | ||
import DateTime from "../src/datetime"; | ||
|
||
const suite = new Benchmark.Suite(); | ||
|
||
const dt = DateTime.local(); | ||
|
||
suite | ||
.add('DateTime.local', () => { | ||
.add("DateTime.local", () => { | ||
DateTime.local(); | ||
}) | ||
.add('DateTime.fromObject with locale', () => { | ||
DateTime.fromObject({ locale: 'fr' }); | ||
.add("DateTime.fromObject with locale", () => { | ||
DateTime.fromObject({ locale: "fr" }); | ||
}) | ||
.add('DateTime.local with numbers', () => { | ||
.add("DateTime.local with numbers", () => { | ||
DateTime.local(2017, 5, 15); | ||
}) | ||
.add('DateTime.fromString', () => { | ||
DateTime.fromString('1982/05/25 09:10:11.445', 'yyyy/MM/dd HH:mm:ss.SSS'); | ||
.add("DateTime.fromString", () => { | ||
DateTime.fromString("1982/05/25 09:10:11.445", "yyyy/MM/dd HH:mm:ss.SSS"); | ||
}) | ||
.add('DateTime.fromString with zone', () => { | ||
DateTime.fromString('1982/05/25 09:10:11.445', 'yyyy/MM/dd HH:mm:ss.SSS', { | ||
zone: 'America/Los_Angeles' | ||
.add("DateTime.fromString with zone", () => { | ||
DateTime.fromString("1982/05/25 09:10:11.445", "yyyy/MM/dd HH:mm:ss.SSS", { | ||
zone: "America/Los_Angeles" | ||
}); | ||
}) | ||
.add('DateTime#setZone', () => { | ||
dt.setZone('America/Los_Angeles'); | ||
.add("DateTime#setZone", () => { | ||
dt.setZone("America/Los_Angeles"); | ||
}) | ||
.add('DateTime#toFormat', () => { | ||
dt.toFormat('yyyy-MM-dd'); | ||
.add("DateTime#toFormat", () => { | ||
dt.toFormat("yyyy-MM-dd"); | ||
}) | ||
.add('DateTime#add', () => { | ||
.add("DateTime#add", () => { | ||
dt.plus({ milliseconds: 3434 }); | ||
}) | ||
.add('DateTime#toISO', () => { | ||
.add("DateTime#toISO", () => { | ||
dt.toISO(); | ||
}) | ||
.on('cycle', event => { | ||
.on("cycle", event => { | ||
console.log(String(event.target)); | ||
}) | ||
// eslint-disable-next-line func-names | ||
.on('complete', function() { | ||
console.log('Fastest is ' + this.filter('fastest').map('name')); | ||
.on("complete", function() { | ||
console.log("Fastest is " + this.filter("fastest").map("name")); | ||
}) | ||
.run(); |
Oops, something went wrong.