-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2 Feature Discussion #37
Comments
I would be nice if there was a version that does not alter the default Date object prototype. |
Check out cromag.js |
I want crop feature. sometimes I need to set milisecond, second, minute field to zero. I'd like to see that feature in date-utils. |
What about i18n? :) |
Just to continue on #36 and compacting the API, I would propose the following:
Doing this would remove 20-21 functions/methods from the API depending whether you go with Maybe there are other ways to compact but these seem the most obvious. |
i like the idea of compacting the api - want to finish documenting everything so there is fresh knowledge, and a good tag for 1.x. |
It would be nice if the toFormat( ) series of functions took symbols for timezones such as Z etc. So we can generate string dates that have an offset of -05:00 for example |
@jadrake75 if you can expand that into a set of rules, it would help a lot - at that point we can talk about a complete ruleset and set up boundaries. |
I would love chainable ruby/rails like dates (I know this is js, but bare with me). I would love to be able to code: 7.days().from_now()
14.minutes().ago() I realize that we're not going to extend the Number object, but something like. Date.integer(7).days().from_now().at_beginning_of_day() // hh:mm:ss.ms / 00:00:00.000
Date.integer(7).days().from_now().at_end_of_day() // hh:mm:ss.ms / 23:59:99.999
Date.i(14).minutes.ago()
Date.i(15).days().since(Date.i(1).week().ago())
Date.between(new Date("1/1/2014"), new Date("12/11/2014")).days() would be amazing! |
I would like to see a static method added as a proxy to calling the constructor. This would ease testing by providing a method that can be easily mocked. Perhaps... I may be missing something with testing as I'm just getting started, however I can't figure out how to mock a constructor using Jest. In fact I think I will fork and add this. Would you consider a pull request to add it? |
i'm curious what this would add, since it would be a synonym to as an aside, |
It is indeed. I've given it some more thought and I don't think it would help me with testing anyway since date-utils extends the global Date object. As far as I know Jest doesn't have a way to mock objects/methods unless they can be loaded with require(). Sorry for the spurious suggestion. The library is very nice, thank you for providing it. |
Some examples:
etc. |
An ordinal suffix for the day of month, like 2nd, 6th, etc would be incredibly useful. Like the |
Let's talk about possible features and changes for version 2!
The text was updated successfully, but these errors were encountered: