hapijs / joi-date

Joi extensions for dates
Other
83 stars 25 forks source link

Add date-fns instead of moment #33

Open svkorepanov opened 3 years ago

svkorepanov commented 3 years ago

Support plan

Context

What problem are you trying to solve?

Recently I've faced with date validation via Joi, and luckily I found this library. But unfortunately there is a moment.js in deps and I don't want to bring this library in my project as a dependency. I guess a lot of developers don't want it either. I suggest moving to more modern date library such as date-fns instead of moment.js. And I would happy to help you with this.

Do you have a new or modified API suggestion to solve the problem?

vicmars5 commented 3 years ago

Also, would be good to mention that moment js is deprecated. https://momentjs.com/docs/

But my main questions would be: does date-fns use the same date format or API as moment.js? If it isn't, this change can break existing code bases if the update the joi-date version.

Izabrr commented 3 years ago

Hi 👋 Any update on this topic ?

hueniverse commented 3 years ago

I don't have time to do the work but if someone wants to open a PR for this, I'll review.

Izabrr commented 3 years ago

@hueniverse I opened this one