diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/i18n/jquery-ui-timepicker-am.js | 21 | ||||
-rw-r--r-- | src/jquery-ui-timepicker-addon.js | 14 |
2 files changed, 32 insertions, 3 deletions
diff --git a/src/i18n/jquery-ui-timepicker-am.js b/src/i18n/jquery-ui-timepicker-am.js new file mode 100644 index 0000000..69cce8a --- /dev/null +++ b/src/i18n/jquery-ui-timepicker-am.js @@ -0,0 +1,21 @@ +/* Armenian translation for the jQuery Timepicker Addon */ +/* Written by Artavazd Avetisyan artavazda@hotmail.com */ +(function($) { + $.timepicker.regional['am'] = { + timeOnlyTitle: 'Ընտրեք ժամանակը', + timeText: 'Ժամանակը', + hourText: 'Ժամ', + minuteText: 'Րոպե', + secondText: 'Վարկյան', + millisecText: 'Միլիվարկյան', + microsecText: 'Միկրովարկյան', + timezoneText: 'Ժամային գոտին', + currentText: 'Այժմ', + closeText: 'Փակել', + timeFormat: 'HH:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['am']); +})(jQuery); diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js index a34d486..1061296 100644 --- a/src/jquery-ui-timepicker-addon.js +++ b/src/jquery-ui-timepicker-addon.js @@ -750,15 +750,22 @@ microsec = parseInt(microsec, 10); } if (timezone !== false) { - timezone = parseInt(timezone, 10); + timezone = timezone.toString(); } var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0]; // If the update was done in the input field, the input field should not be updated. // If the update was done using the sliders, update the input field. - var hasChanged = (hour !== this.hour || minute !== this.minute || second !== this.second || millisec !== this.millisec || microsec !== this.microsec || - (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone)); + var hasChanged = ( + hour !== parseInt(this.hour,10) || // sliders should all be numeric + minute !== parseInt(this.minute,10) || + second !== parseInt(this.second,10) || + millisec !== parseInt(this.millisec,10) || + microsec !== parseInt(this.microsec,10) || + (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || + (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString() + ); if (hasChanged) { @@ -805,6 +812,7 @@ this.timeDefined = true; if (hasChanged) { this._updateDateTime(); + this.$input.focus(); } }, |