Open imns opened 4 years ago
As a quick/dirty fix I did this, but I'm certain it doesn't cover all the edge cases:
function titleCase(str) {
return str
.toLowerCase()
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join("_")
.replace("Gmt", "GMT");
}
const tzs = spacetime.whereIts("4pm").map((tz) => {
let [country, region] = tz.split("/");
return `${titleCase(country)}/${titleCase(region)}`;
});
ah, yeah you're right. I'll add this to the next major.
yeah - there is America/Port-au-Prince
and Antarctica/DumontDUrville
, and also the GMT ones and things.
thanks for the heads-up
Thanks for this great library. 🎉
When can we expect the next release with this resolved?
hey @Great-hijack - sorry for the delay on this. Fraid v8 is looking like mid-summer. cheers
Title pretty much says it all. If I call
spacetime.whereIts('4pm')
it returns:I would expect the timezone names to be in the same format as in the documentation ie:
"America/Jamaica"
as referenced here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.