Comments (3)
Can you give some more concrete examples?
from tz.js.
Sure.
My thought is that while the resulting object is somewhat unique to this library, the attributes of the object could follow Unicode date patterns used by most other libraries one would encounter when dealing with dates.
I usually use date-fns, for example, and would format a date object like this.
formatDate(new Date(), 'MM dd, YYYY');
If your library generated an object with attributes that adhered to Unicode date patterns, you could do the same thing. Example:
// fake object with a few example attributes
var obj = {
MM: 'March',
dd: '3',
YYYY: '2022'
};
var formattedDate = `${obj.MM} ${obj.dd}, ${obj.YYYY}`;
Having the ability to turn a date into an object like this is much more convenient than including date-fns and I'd use such a library all the time.
I must add a disclaimer that my understanding on this topic is limited to usage in my projects, and I am well aware that you really don't know a part of the stack until you get to a point where you could write or have written that part of the stack. Thanks for reading.
from tz.js.
I don't think it's a bad idea, but I don't think it's useful enough over the current structure to warrant an API change.
{
// date
"year": 2021, "month": 2, "day": 14,
// time
"hour": 3, "minute": 15, "second": 59, "millisecond": 0,
// tz
"offset": -240, "timeZoneName": "Eastern Daylight Time"
}
from tz.js.
Related Issues (6)
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 tz.js.