Constructor with custom format
See original GitHub issuemoment.js has wide usable feature to make date from custom strings. For example:
moment('2018-02-01', 'YYYY-DD-MM')
or
moment('02-2018-01', 'DD-YYYY-MM');
Do we want to support this feature in our core? I’m not sure how to implement it in minimalist way, but I think we need to rewrite .format function somehow to avoid copy-paste of code. If you will be agree, guys, that we need to have this feature - I’ll think about it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Providing Constructors for Your Classes (The Java™ Tutorials ...
A class contains constructors that are invoked to create objects from the class blueprint. Constructor declarations look like method declarations—except ...
Read more >java - Throwable constructor with message format parameters
I believe a constructor like that would allow a much more clean and elegant exception handling. throw new Exception(String.format("Illegal value ...
Read more >Guide to Android custom views: constructors | by Marcin Korniluk
Each Android view has up to 4 constructors. In the simple scenario, you usually need only the first two. ... This is the...
Read more >Constructors in Java - GeeksforGeeks
In Java, a constructor is a block of codes similar to the method. It is called when an instance of the class is...
Read more >Constructors (C++) | Microsoft Learn
To customize how a class initializes its members, or to invoke functions when an object of your class is created, define a constructor....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@iamkun Yep using ISO would format is a great advice, but some (me 😄) have to deal with data from other sources which doesn’t support the ISO date format.
@iamkun ✔️ I will try to build one.