| 530 | $input.parent().removeClass('has-error'); |
| 531 | // treat date as UTC time at midnight |
| 532 | var strTime = function(x) { |
| 533 | var s = type === 'date' ? 'T00:00:00Z' : ''; |
| 534 | var t = new Date(x + s).getTime(); |
| 535 | // add 10 minutes to date since it does not hurt the date, and |
| 536 | // it helps avoid the tricky floating point arithmetic problems, |
| 537 | // e.g. sometimes the date may be a few milliseconds earlier |
| 538 | // than the midnight due to precision problems in noUiSlider |
| 539 | return type === 'date' ? t + 3600000 : t; |
| 540 | }; |
| 541 | if (inArray(type, ['date', 'time'])) { |
| 542 | v[0] = strTime(v[0]); |
| 543 | v[1] = strTime(v[1]); |