smalot / bootstrap-datetimepicker

Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)
http://www.malot.fr/bootstrap-datetimepicker/
Apache License 2.0
3.49k stars 1.65k forks source link

The DateFormat Bug #715

Open gwsh1234 opened 6 years ago

gwsh1234 commented 6 years ago

If you dateformat is 'yyyy' or others which is only numbers , the number data will cause datetimepicker throw a exception. Before parse date data, you should judge its number type or not. If it is number type, you should convert it to String type. Maybe like this. if(typeof date == 'number'){ date = String(date); } I insert that code in bootstrap-datetimepicker.js file after parse the data.