diff --git a/.eslintrc.json b/.eslintrc.json index 4d7af7256..20647c2ab 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,7 +7,10 @@ "files": ["**/*.ts", "**/*.tsx"], "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"], - "extends": ["plugin:@typescript-eslint/recommended"] + "extends": ["plugin:@typescript-eslint/recommended"], + "rules": { + "@typescript-eslint/no-unused-vars": "error" + } } ], "rules": { @@ -16,7 +19,7 @@ "import/first": "error", "import/newline-after-import": "error", "import/no-duplicates": "error", - "@typescript-eslint/no-unused-vars": "error", - "no-console": ["error", { "allow": ["warn", "error", "info"] }] + "no-console": ["error", { "allow": ["warn", "error", "info"] }], + "no-unused-vars": "error" } } diff --git a/apps/docs/images/self-hosting/spacetime.html b/apps/docs/images/self-hosting/spacetime.html new file mode 100644 index 000000000..504c34e7a --- /dev/null +++ b/apps/docs/images/self-hosting/spacetime.html @@ -0,0 +1,227 @@ + + +
+ +<script src="https://unpkg.com/spacetime"></script>
<script>
// make a new Date in New York
var d = spacetime('March 1 2012', 'America/New_York')
d = d.time('4:20pm')
d = d.goto('America/Los_Angeles')
d.time()
//'1:20pm'
</script>
// npm install spacetime
var spacetime = require('spacetime')
​
var d = spacetime.now('Europe/Paris')
d.isAsleep()
//true
​
d.dayName()
//'Wednesday'
//make a new date in a remote timezone:
let s = new spacetime('January 5 2018', 'Africa/Djibouti')
​
//query it like this:
s.date()//5 âœ”ï¸ weee!
s.monthName()//'january' ✔ï¸
s.year()//2018 ✔ï¸
​
//inspect the daylight-savings-time:
s.inDST()//false
s.hasDST()//false
s.offset()//3 (hours) ✔ï¸
​
//you can change the date/time:
s = s.date(7) //jan 7th
s = s.time('4:30pm')
s = s.year(2019) //jan 7th 2019
​
//this same moment, but in Namibia:
s = s.goto('Africa/Windhoek')//false
s.time() //'2:30pm'
​
//Namibia is currently in daylight-savings time
s.isDST()//true
s.offset()//1 (hour)
​
//but after april 2nd, fall-back
s = s.month('april').date(3)
s.isDST()//false
s.offset()//0
​
d = new Date(fakeParis)
d.getHours()// âœ”ï¸ weee!
+ but hold up - +
d = new Date(fakeParis)
d.setHours(6)// âœ–ï¸ uh-oh
var localTime = fakeParis - parisOffset + myOffset
local = new Date(localTime)
local.setHours(6)// 🎉
var parisAgain = local.getTIme() - myOffset + parisOffset
// ¯\_(ツ)_/¯