diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-04-15 06:30:32 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-04-15 06:30:32 +0300 |
commit | d1b77a2949e2678595c68ffbadc74823f273630b (patch) | |
tree | a641013dad59a7d4cf53904d8319fc971a71784f /js/functions.js | |
parent | 4ae2e6f6b18056ac076d3c76d9099b29d66be223 (diff) | |
parent | 91da1a8f38eb94e7d5c9b7dd4aac57b257ce17f3 (diff) |
Merge branch 'QA_4_4'
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/js/functions.js b/js/functions.js index 6020bc2f06..4ab67448bd 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1114,19 +1114,24 @@ function addDateTimePicker() { if ($.timepicker !== undefined) { $('input.timefield, input.datefield, input.datetimefield').each(function () { - no_decimals = $(this).parent().attr('data-decimals'); + var decimals = $(this).parent().attr('data-decimals'); + var type = $(this).parent().attr('data-type'); + var showMillisec = false; var showMicrosec = false; var timeFormat = 'HH:mm:ss'; // check for decimal places of seconds - if (($(this).parent().attr('data-decimals') > 0) && ($(this).parent().attr('data-type').indexOf('time') != -1)){ - showMillisec = true; - timeFormat = 'HH:mm:ss.lc'; - if ($(this).parent().attr('data-decimals') > 3) { + if (decimals > 0 && type.indexOf('time') != -1){ + if (decimals > 3) { + showMillisec = true; showMicrosec = true; + timeFormat = 'HH:mm:ss.lc'; + } else { + showMillisec = true; + timeFormat = 'HH:mm:ss.l'; } } - PMA_addDatepicker($(this), $(this).parent().attr('data-type'), { + PMA_addDatepicker($(this), type, { showMillisec: showMillisec, showMicrosec: showMicrosec, timeFormat: timeFormat |