diff --git a/apps/docs/images/self-hosting/spacetime.html b/apps/docs/images/self-hosting/spacetime.html deleted file mode 100644 index 504c34e7a..000000000 --- a/apps/docs/images/self-hosting/spacetime.html +++ /dev/null @@ -1,227 +0,0 @@ - - -
- -<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
// ¯\_(ツ)_/¯