Fixed bug with custom time range not being initialized correctly, Fixes #1427
This commit is contained in:
Vendored
+1
-1
@@ -79,7 +79,7 @@ angular.module('$strap.directives').directive('bsDatepicker', [
|
||||
var language = options.language || 'en', readFormat = attrs.dateFormat || options.format || $.fn.datepicker.dates[language] && $.fn.datepicker.dates[language].format || 'mm/dd/yyyy', format = isAppleTouch ? 'yyyy-mm-dd' : readFormat, dateFormatRegexp = regexpForDateFormat(format, language);
|
||||
if (controller) {
|
||||
controller.$formatters.unshift(function (modelValue) {
|
||||
return type === 'date' && angular.isString(modelValue) && modelValue ? $.fn.datepicker.DPGlobal.parseDate(modelValue, $.fn.datepicker.DPGlobal.parseFormat(readFormat), language) : modelValue;
|
||||
return type === 'date' && angular.isString(modelValue) && modelValue ? $.fn.datepicker.DPGlobal.parseDate(new Date(modelValue), $.fn.datepicker.DPGlobal.parseFormat(readFormat), language) : modelValue;
|
||||
});
|
||||
controller.$parsers.unshift(function (viewValue) {
|
||||
if (!viewValue) {
|
||||
|
||||
Reference in New Issue
Block a user