timeoff-management / timeoff-management-application

Simple yet powerful absence management software for small and medium size business (community edition)
https://TimeOff.Management
MIT License
951 stars 588 forks source link

Date format selection bug: Bank Holidays #103

Closed enriquetoledano closed 7 years ago

enriquetoledano commented 7 years ago

Hi:

There's a bug in general settings page, related to the new feature of selection of date format. If I use the standard date format (YYYY-MM-DD), the bank holidays works perfect. But if I use another format, the bank holidays doesn't work at all. Let's see an example: I start with (YYYY-MM-DD) and create the Labour Day (first of May) and it works correctly. In the DB it appears as 2017-05-01 00:00:00.000 +00:00. If I change to (DD/MM/YYYY), it works correct if I don't change any holiday, but if now I create another bank holiday (2 of may, for example), everything broke: Now the labour day is seen as 5 of January and in the DB it appears as 2017-01-04 23:00:00.000 +00:00. Also, the newly created 2 of may appears as 5 of February and appears as 2017-02-04 23:00:00.000 +00:00 in the DB.

Best regards

vpp commented 7 years ago

hi @enriquetoledano

Really detailed description. I will have a look at it ASAP.

vpp commented 7 years ago

Fixed and deployed on http://timeoff.management

enriquetoledano commented 7 years ago

Hi: When using date format DD/MM/YYYY, I still can't create a new bank holiday:

bug

Best regards

vpp commented 7 years ago

hi @enriquetoledano,

thank you for reporting it.

Looks like validator.js isDate is not happy with "random" date formats.

It happened that I checked the feature only on those formats that works with isDate...

I will refactore date validations throughout the application to take it into consideration.

Thank you again for your time and effort to report these problems. Btw, I am coding your scenarios into automated tests so they are included into regression that is run before each deployment.

vpp commented 7 years ago

Should be fixed now,