Comments (5)
hey Kira, yeah I remember this being a weird thing that we didn't do terribly well.
This would be a cool feature. There may be some weird stuff with daylight-time abbreviations. I'm not sure how best to do it.
for now, i'd recommend looking at this file, which has, i think, all the information you'd need to map from one to the other.
something like this?
cheers
from spacetime.
+1 for GMT+0800 format --> standard javascript new Date().toString()
from spacetime.
hey Kira, i've got this abbreviation stuff added to 5.1.0. It was super-hard. AFIAK, this is the only timezone library to implement this kinda feature.
you can enter timezone abbreviations, like 'EST', and it will assign an IANA code, and then get abbreviations with s.timezone().display
There will be some issues, please let me know if when you find them.
cheers
from spacetime.
( https://runkit.com/spencermountain/5c2a7b4f2ace1500125ea794 )
from spacetime.
hey @wyang36 just a heads-up, I'm working on moving this abbreviation stuff to a separate package, to keep spacetime lightweight.
It'll be in v6, in the next few weeks, and will be documented in the changelog.
cheers
from spacetime.
Related Issues (20)
- s.diff(d, 'days') is off by one HOT 4
- Unable to chain .i18n() with .format() methods HOT 1
- Unexpected results near DST 2023 boundaries (Europe/Helsinki) HOT 4
- Month number is always -1 HOT 3
- ISO offset vs IANA code ambiguities HOT 5
- DST Result for "Asia/Tehran" is wrong HOT 1
- [Typescript] Could not find declaration file for module 'spacetime' HOT 1
- dayOfYear in leap years HOT 3
- Failing timezone conversion from Zulu to Europe/Rome HOT 1
- Times of the day seem illogical HOT 9
- week function not working correctly HOT 8
- Specific date is not getting the correct epoch HOT 1
- toNativeDate does not factor in timezone offset HOT 3
- Question about making plugins HOT 4
- The new zone `America/Ciudad_Juarez` is missing HOT 3
- Spacetime not working in MacOS Sonoma (Cannot find timezone named: 'cet'. Please enter an IANA timezone id) HOT 7
- Epoch values not updating for different timezones HOT 4
- Incorrect Africa/Casablanca offset HOT 3
- Daylight savings error with timezone HOT 1
- Africa/Cairo: wrong TZ offset HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spacetime.