Skip to content
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

Add support for js-joda #53

Closed
jonfreedman opened this issue Jun 24, 2019 · 16 comments
Closed

Add support for js-joda #53

jonfreedman opened this issue Jun 24, 2019 · 16 comments

Comments

@jonfreedman
Copy link

js-joda is an immutable date and time library which is often mentioned alongside the other alternatives to moment.js.

It would be great to include and would allow easy use with Material-UI Pickers.

@dmtrKovalenko
Copy link
Owner

43 kb?!!!

@dmtrKovalenko
Copy link
Owner

I think we should not recommend it for users :)

@jonfreedman
Copy link
Author

Isn't the whole point of this library to make it easier for people to choose? I'll have to check what size is left in my app after tree shaking.

@dmtrKovalenko
Copy link
Owner

Yeah, but the cost of supporting this library in official monorepo will be much incompatible with users, that are using this lib.

It is still possible to make your own adapter. Just implement interface and publish npm package.

@prinzdezibel
Copy link

prinzdezibel commented Jan 10, 2020

For all people who need it nonetheless please head over to: https://github.com/prinzdezibel/date-io

@dmtrKovalenko: May I ask you to reconsider your decision? Oftentimes one is not in the position to choose the date utility library used for a given project. Those people may have no choice but to stick with js-joda. Besides from that js-joda seems to be a very complete and mature library with "localization" batteries included. This may well justify its somewhat bigger size.

I would be very happy to file a PR if you change your mind, @dmtrKovalenko.

@dmtrKovalenko
Copy link
Owner

dmtrKovalenko commented Jan 10, 2020

My main thoughts:

  1. this is not so popular library (https://www.npmtrends.com/@js-joda/core-vs-date-fns-vs-moment)
  2. So giant bundlesize https://bundlephobia.com/result?p=@js-joda/core@2.0.0
  3. Too often breaking changes releases

I am not really against of supporting a lot and a lot of libraries, but each new library makes support of @date-io harder and harder. If there is a reasonable answer why you are choosing js-joda instead of other libs, I think it should not be a problem to add this to the main repo

Anyway we add a link to your npm library and GitHub repo with support of js-joda from the official documentation

@prinzdezibel
Copy link

prinzdezibel commented Jan 13, 2020

Our team's main reason to choose js-joda over any of the alternatives:

  • Domain driven representation of different concepts like Instant, LocalDateTime or ZonedDateTime rather than wrapping/patching a jack-of-all-trades type like JavaScript's date type.

I think it should not be a problem to add this to the main repo

I'd love to hear that date-io is officially supporting js-joda!

@tlhfckoctbcr
Copy link

I also heavily use js-joda and would like to see date-io supporting it.

@prinzdezibel
Copy link

@grantsru Please checkout this fork https://github.com/prinzdezibel/date-io (supports only v1.3.13 of @date-io/core for now)

@dmtrKovalenko
Copy link
Owner

@prinzdezibel if you could extract and publish your date-io package separately from fork - I would love to add a link to the README

@prinzdezibel
Copy link

@dmtrKovalenko What are your thoughts on supporting it officially in your project? (provided that my work is compatible with v2, of course)

@YarnSphere
Copy link

I'm also interested in support for js-joda integration and would like to see this issue reopened.

My usecase: Kotlin's officially supported multiplatform datetime library kotlinx-datetime uses js-joda in the JS side; kotlinx-datetime allows us to have a single representation of dates in multiple platforms when writing Kotlin code (server/JVM, Android, web/JS, etc).

Since our web frontend integrates with Kotlin-compiled JS code which is already using js-joda, it would make little sense to introduce a second date library.

@dspiteself
Copy link
Contributor

@dmtrKovalenko https://bundlephobia.com/package/@js-joda/core@4.0.0 is half the size of https://bundlephobia.com/package/moment@2.29.1
It is also extremely stable the root of the api has not changed since 2014.
I am not saying moment is the exemplar. The nice part about joda-time is that the distinct type LocalDate vs ZonedDate and LocalDateTime vs ZonedLocalDateTime really help my devs avoid muddled thinking about dates, timezones and time. I just made a new pull request #589 It is a bit more abstract than previous attempts everything is hung off the abstract type Temporal. If you want I can get it up to 100 % coverage. I would take responsibility for its maintenance. If you still are not interested I would like to investigate another repository outside the monorepo, but maybe privilege to release to @date-io/js-joda .
Thanks for your work in maintaining this library.

@dmtrKovalenko
Copy link
Owner

@dspiteself sorry for not answering I was sure that I responded, I am totally OK for supporting js-joda, so if you can get PR up to 100% coverage – I`ll merge and publish it

@dspiteself
Copy link
Contributor

One more interesting thing with js-joda is that JavaScript Temporal #466 is very close to js-joda mainly some renames and a few changes to JavaScript idiom.

@gregfenton
Copy link

Our team's main reason to choose js-joda over any of the alternatives:

  • Domain driven representation of different concepts like Instant, LocalDateTime or ZonedDateTime rather than wrapping/patching a jack-of-all-trades type like JavaScript's date type.

In our team's case (decision predates my involvement):

  • alignment to use of, and experience with, Joda in an associated Java codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants