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

Improve the Date API #467

Closed
imeckler opened this Issue Dec 26, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@imeckler
Contributor

imeckler commented Dec 26, 2015

I think the Date API would really benefit from a function

ofYearMonthAndDay : { year : Int, month : Month, day : Int } -> Result String Date

since now the only ways of creating a date are from a string or a Time.
I'm not the best at naming things, so other name suggestions for this function would be much appreciated.

It's a bit (though not entirely) of a separate issue, but it seems a Date is actually a calendar date equipped with a time of day. Thus the above function should in an ideal world be

ofCalendarDateAndTime : { calendarDate : CalendarDate, time : TimeOfDay } -> Date

where CalendarDate is implemented by { year : Int, month : Month, day : Int} and TimeOfDay is implemented by Time.

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

lukewestby Dec 29, 2015

Member

@imeckler These would be well suited for inclusion here until such a time that they might be included in core 😃

Member

lukewestby commented Dec 29, 2015

@imeckler These would be well suited for inclusion here until such a time that they might be included in core 😃

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 19, 2016

Contributor

@lukewestby, the link you give (https://github.com/lukewestby/elm-date-extra) leads into nothingness. But I agree that given this policy it probably makes more sense to target another package with this feature request than core. Maybe https://github.com/rluiten/elm-date-extra?

Contributor

jvoigtlaender commented Jan 19, 2016

@lukewestby, the link you give (https://github.com/lukewestby/elm-date-extra) leads into nothingness. But I agree that given this policy it probably makes more sense to target another package with this feature request than core. Maybe https://github.com/rluiten/elm-date-extra?

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 19, 2016

Contributor

Or maybe https://github.com/rluiten/elm-date-extra does already provide the sought functionality?

Contributor

jvoigtlaender commented Jan 19, 2016

Or maybe https://github.com/rluiten/elm-date-extra does already provide the sought functionality?

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

lukewestby Jan 19, 2016

Member

Ah, sorry! I completely forgot to update this issue. Yes! Robin took over the effort on elm-date-extra, https://github.com/rluiten/elm-date-extra is the "official" unofficial date extensions package. It does not currently provide the suggested functionality.

Member

lukewestby commented Jan 19, 2016

Ah, sorry! I completely forgot to update this issue. Yes! Robin took over the effort on elm-date-extra, https://github.com/rluiten/elm-date-extra is the "official" unofficial date extensions package. It does not currently provide the suggested functionality.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Feb 4, 2016

Contributor

@imeckler, can this be closed here? Take it up in https://github.com/rluiten/elm-date-extra?

Contributor

jvoigtlaender commented Feb 4, 2016

@imeckler, can this be closed here? Take it up in https://github.com/rluiten/elm-date-extra?

@imeckler

This comment has been minimized.

Show comment
Hide comment
@imeckler

imeckler Feb 4, 2016

Contributor

@jvoigtlaender Sounds good

Contributor

imeckler commented Feb 4, 2016

@jvoigtlaender Sounds good

@imeckler imeckler closed this Feb 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment