medic / bikram-sambat

Javascript and Java utilities for converting between the Nepali Bikram Sambat (Vikram Samvat) and Gregorian (standard European) calendars.
Apache License 2.0
10 stars 10 forks source link

Throw an error on bikram-sambat-bootstrap for invalid date #17

Closed 1yuv closed 1 year ago

1yuv commented 1 year ago

The updateBackingDateInput function sets the date only when the date is valid. Because of this in a form when a date is updated and invalid date is inputed by user, an error is not thrown since the bootstrap would still give the valid old date because of this condition.

We should be setting whaterver the converted value is coming instead of setting the value only when valid date is available. The current behavior causes issues like this.

1yuv commented 1 year ago

This has been tested and fixed on medic/cht-core#7925, closing as fixed.