Skip to content

Move time rules to an extension #985

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

Closed
hueniverse opened this issue Sep 16, 2016 · 7 comments
Closed

Move time rules to an extension #985

hueniverse opened this issue Sep 16, 2016 · 7 comments
Assignees
Labels
breaking changes Change that can breaking existing code dependency Update module dependency
Milestone

Comments

@hueniverse
Copy link
Contributor

I really REALLY wants to get rid of the moment dependency. My bet is that date validation is rarely used and we're all installing this gigantic module for no reason.

@hueniverse hueniverse added breaking changes Change that can breaking existing code dependency Update module dependency labels Sep 16, 2016
@AdriVanHoudt
Copy link
Contributor

it is only used on this line

date = Moment(value, format, true);
so only moving out the format part is enough no?

@hueniverse
Copy link
Contributor Author

Sure.

@Marsup
Copy link
Collaborator

Marsup commented Sep 16, 2016

Planning on it, although it's not very high on my list. What's the sudden need?

@paulovieira
Copy link
Contributor

paulovieira commented Oct 3, 2016

fecha might be an alternative. It's small and has no dependencies.

https://github.com/taylorhakes/fecha

Works well to parse a date in a string in some expected format. Example:

fecha.parse('10-12-10 14:15:16', 'YY-MM-DD HH:mm:ss');  // returns a Date object
fecha.parse('10-12-10 14:15', 'YY-MM-DD HH:mm:ss');  // returns false

@thebergamo
Copy link

fecha sounds a good alterantive.
@AdriVanHoudt moment is used in the line above too, to validate if the date is valid, using fecha you can supress this 2 lines in just one, because if the validation fails, its return false, so, just on ternary is wanted.

@DavidTPate
Copy link
Contributor

The thing with moving over to something like fecha is that the current contract will be broken (so as long as that is noted and versioned appropriately that's fine). moment is large because it ships with a ton of locales while fecha requires you to define those locales for yourself.

@AdriVanHoudt
Copy link
Contributor

I don't think replacing moment is a solution. Just remove this and make a plugin of it

@Marsup Marsup self-assigned this Nov 12, 2016
@Marsup Marsup added this to the 10.0.0 milestone Nov 12, 2016
@Marsup Marsup closed this as completed in 2963e1b Nov 12, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code dependency Update module dependency
Projects
None yet
Development

No branches or pull requests

6 participants