0

I'm trying to make a masked DatePicker using Kendo UI. Fortunately i have found an example how to achieve this:

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/datepicker/how-to/masked-date-picker-grid

Unfortunately i can't change the mask from 00/00/0000 into this one:

$(element).kendoMaskedTextBox({ mask: that.options.dateOptions.mask || "rrrr-mm-dd" })

Because it breaks its functionality. Anyone got any ideas how can i change mask in this example ?

mctl87
  • 351
  • 8
  • 16

1 Answers1

0

Along with the mask, the format needs to set as well when initializing the plugin

$('#datePicker').kendoMaskedDatePicker({
    dateOptions: {
        mask: '0000-00-00',
        format: 'yyyy-MM-dd'
    }
});

I've created an updated sample here for you to verify.

Joel D'Souza
  • 986
  • 6
  • 15
  • Thanks but that's not what i was looking for :) I'm looking for a way to change these "_" default prompt chars and this mask ____ - __ - __ into this one "rrrr-mm-dd". AFAIK masked textbox does not provide such functionality ootb :( – mctl87 Sep 20 '15 at 22:15
  • Ah, the MaskedTextBox has a promptChar configuration option that allows you to change the "_" into a character of choice : http://docs.telerik.com/kendo-ui/api/javascript/ui/maskedtextbox#configuration-promptChar You can dig through the MaskedTextBox source scanning for uses of the promptChar option and build your custom needs in. – Joel D'Souza Sep 20 '15 at 22:23