pschloss / yowbook

My flock maintenance Rails app
MIT License
1 stars 0 forks source link

Pre-load default date with today's date #12

Closed pschloss closed 7 years ago

pschloss commented 7 years ago

Imagine if someone is in their barn adding new lambs, would be tedious to manually type in dates when most of the dates are from today or within a day or two

pschloss commented 7 years ago

Thought it would be good to also have date format checking. I suspect some pushback on YYYY-MM-DD format in the future. The validate_timeliness gem I'm using would allow for multiple other formats. The problem with this is that the rest of the world uses DD-MM-YYYY with the US using MM-DD-YYYY. The problem is that although 15/12/2016 might be obvious, 4/12/2016 is not. I believe PedigreeWizard allows users to select the format that the user prefers. May be worth thinking about for the future since we'll probably want customization for other things, eg. weights.

pschloss commented 7 years ago

I initially put the default into the model, but that posed problems because if someone put in an invalid date, then the date would default back to the current date without a warning. Currently, the default is put into the view.