File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1823
1823
return String ( hour ) ;
1824
1824
} ;
1825
1825
1826
+ var computeEffectiveSetting = function ( settings , property ) {
1827
+ return settings && settings [ property ] ? settings [ property ] : $ . timepicker . _defaults [ property ] ;
1828
+ } ;
1829
+
1826
1830
/*
1827
1831
* Splits datetime string into date and time substrings.
1828
1832
* Throws exception when date can't be parsed
1832
1836
try {
1833
1837
// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
1834
1838
// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
1835
- var separator = timeSettings && timeSettings . separator ? timeSettings . separator : $ . timepicker . _defaults . separator ,
1836
- format = timeSettings && timeSettings . timeFormat ? timeSettings . timeFormat : $ . timepicker . _defaults . timeFormat ,
1839
+ var separator = computeEffectiveSetting ( timeSettings , ' separator' ) ,
1840
+ format = computeEffectiveSetting ( timeSettings , ' timeFormat' ) ,
1837
1841
timeParts = format . split ( separator ) , // how many occurrences of separator may be in our format?
1838
1842
timePartsLen = timeParts . length ,
1839
1843
allParts = dateTimeString . split ( separator ) ,
You can’t perform that action at this time.
0 commit comments