-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expand timezone fingerprint #63
Comments
concept inspired by https://github.com/ghacksuserjs/TorZillaPrint const confirmTimezone = timezone => {
let lie = false
const minute = 60000
const winter = new Date('1/1/1984')
const spring = new Date('4/1/1984')
const summer = new Date('7/1/1984')
const fall = new Date('10/1/1984')
const winterUTCTime = +new Date('1984-01-01')
const springUTCTime = +new Date('1984-04-01')
const summerUTCTime = +new Date('1984-07-01')
const fallUTCTime = +new Date('1984-10-01')
const date = {
winter: {
time: (+winter - winterUTCTime)/minute,
parse: (Date.parse(winter) - winterUTCTime)/minute
},
spring: {
time: (+spring - springUTCTime)/minute,
parse: (Date.parse(spring) - springUTCTime)/minute
},
summer: {
time: (+summer - summerUTCTime)/minute,
parse: (Date.parse(summer) - summerUTCTime)/minute
},
fall: {
time: (+fall - fallUTCTime)/minute,
parse: (Date.parse(fall) - fallUTCTime)/minute
}
}
lie = !!Object.keys(date).filter(key => {
const season = date[key]
return season.time != season.parse
}).length
lie = !new Set(
[].concat(
...Object.keys(date).map(key => {
const season = date[key]
return [season.time, season.parse]
})
)
).has(timezone)
return { ...date, lie }
}
const timezone = new Date().getTimezoneOffset()
console.log(confirmTimezone(timezone)) |
console.log(getLocale()) -> type error |
LOL, 1984 is an interesting year. "Time After Time" by Cyndi Lauper became a major hit that year.
Hmmm... I'm not seeing this in FF nightly. I'll refactor a bit and see what I can find. |
|
it's display names that causes a problem (on nightly) try {
const { locale } = new Intl[name]().resolvedOptions()
lang[name] = locale
} catch(e) {
console.debug(name, e.name, e.message)
} DisplayNames is missing
|
Should be fixed in 14a08d6. I threw |
I'm going to nab this and expand my languages section on TZP current
I do have DisplayNames on my ToDo (obviously not landed in FF yet), and I do have extra stuff here ToDo with Collator, and I guess I check the other ones in the formatting section, but it'd be nice to add the missing ones in this section |
Go for it. Always welcome. I'm commenting out |
don't forget 1423593 😁 .... PS: here's DisplayNames |
concept
https://jsfiddle.net/s5pdt37r/3/
The text was updated successfully, but these errors were encountered: