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
Missing methods from "date-fns" #479
Comments
Hey, thanks for raising this. My question – how you are planning to use date-io? If this really required I can add these methods – it's not a problem.
|
@dmtrKovalenko I am forking react-datepicker and trying to make it agnostic of the date-management library so it can support additional calendar systems. I ended up creating the above functions using the available functions from |
Awesome! I will add all the required functions, but probably except the
Give me a few days to make a PR and new version |
That's debateable.
1 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date |
Yeah, that's weird. Thanks @eps1lon I will update the logic accrosss all the adapters |
has this been done? I don't see any reference to parseISO in the codebase |
I was using "date-fns" and wanted to move to use "date-io" interface but I found a couple of methods that I am using are missing.
Methods
isDate
addYears
can be substituted withaddMonths(date, 12)
subMonths
can be substituted withaddMonths(date, -1)
subYears
can be substituted withaddMonths(date, -12)
getWeek
getQuarter
setQuarter
min
max
differenceInCalendarDays
differenceInCalendarMonths
differenceInCalendarYears
startOfQuarter
startOfYear
isSameQuarter
parseISO
getTime
getDay
getDate
I know that some of these methods can be achieved by using other methods in the current interface but am not sure how to handle the ones that aren't.
I am not sure if adding these methods to the interface is the best option since it will increase the API surface, what do you guys suggest for these kinds of situations?
The text was updated successfully, but these errors were encountered: