(function ($) { var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, proxy = $.proxy, CHANGE = 'change', PROGRESS = 'progress', ERROR = 'error', NS = '.generalInfo'; var MaskedTimePicker = Widget.extend({ init: function (element, options) { var that = this; Widget.fn.init.call(this, element, options); var mask = '00:00'; var format = 'HH:mm'; var parseFormats = 'HH:mm'; if (typeof options !== 'undefined') { $.each(options, function (index, value) { if (index == 'dateOptions.mask') { mask = value; } if (index == 'dateOptions.format') { format = value; } if (index == 'dateOptions.parseFormats') { parseFormats = value; } }); } $(element) .kendoMaskedTextBox({ mask: mask }) .kendoTimePicker({ format: format, parseFormats: parseFormats }) .closest('.k-timepicker') .add(element) .removeClass('k-textbox'); that.element.data('kendoTimePicker').bind('change', function () { that.trigger(CHANGE); }); }, options: { name: 'MaskedTimePicker', dateOptions: {} }, events: [CHANGE], destroy: function () { var that = this; Widget.fn.destroy.call(that); kendo.destroy(that.element); }, value: function (value) { var datetimepicker = this.element.data('kendoTimePicker'); if (CommonUtils.isNullOrUndefined(value)) { return datetimepicker.value(); } datetimepicker.value(value); } }); ui.plugin(MaskedTimePicker); })(window.kendo.jQuery);