Comments (5)
In my humble opinion, the only useful ones in that list are h/hh
and k/kk
(and still not sure about them, can't think on an use case). The rest doesn't look like human-friendly formats.
from dayjs.
I would tend to agree, I think that Q, DDD/DDDD, X/x, and S/SS/SSS are definitely not necessary. I think if h/hh is included, then a/A should probably be included as well, or you lose the ability to show specific times (1:00 vs 1:00 AM).
"Do" is kind of up in the air for me, because I've had clients who've insisted on having the ordinal (1st, 2nd, 3rd, etc) shown, but it's something that a user could implement on their own. I think most of it comes down to "what should be provided by a library" vs. "what can a user be reasonably expected to write themselves," and I think that's mostly up to the owner of the repo.
from dayjs.
I tend to agree adding h/hh & a/A(with local). And leave the rest formats to a separate plugin, maybe called AdvFormat
It will be nice if we implement a plugin system like this.
import { AdvFormat } from 'dayjs/plugin'
dayjs.extend('AdvFormat') // a plugin might add a new API or overwrite the existing one
//here it just overwrite the core.format
dayjs.format('Do SSS ... something less useful format')
from dayjs.
I've updated #68 to only have AM/PM and 12 hour time support, with additional options included in another plugin (and the addition of a plugin system).
from dayjs.
The PR from #68 has been split into #91 and #92.
from dayjs.
Related Issues (20)
- Parse format DD-MM-YYYY is interpreted as MM-DD-YYYY HOT 2
- Wrong timezone conversion when tz != browser tz
- GTM timezone is not handled correctly
- Dayjs subtract does not support week based dayjs durations => expected?
- The function "format" would be broken after "utcOffset" being invoked twice and more
- Return Timezone list ? HOT 2
- 时间获取错误 HOT 2
- Dayjs considers Saturday to be the first day of week i.e. date.day() == 0 for Saturday
- Parse date string with timeZone invalid in strict mode
- Locale FI - breaks from other languages in relative time format
- Many issues with dates under year 100 (0099 ... 0001, 0000, -0001, -0002, ...)
- utc plugin requires specification of parsing format HOT 3
- dayjs("02-29") return “2001-03-01” HOT 1
- Inconsistent behaviour of diff(.., 'months) on leap days
- .diff method returns the wrong result
- add() result is wrong with timezone
- Best way to get "This Weekend" or "Next Weekend" ?
- Converting timestamp to utc returns same timestamp
- timezone output wrong result HOT 1
- fix localized format for `el` locale
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 dayjs.