javascript - MVC & jQuery DatePicker - Remove Date Pattern -
i'm struggling datepicker voodoo , can't seem crack it.
given model date field like:
[display(name = "mydate", description = "please provide date")] [datatype(datatype.date)] [required(errormessage = "you need specify date")] [displayformat(nulldisplaytext = "")] public datetime? mydate { get; set; }
i have editor template:
@model datetime? @{ @html.textbox("", (model.hasvalue ? model.value.tostring("d") : string.empty), new { @class = "datefield date-editor", type = "date" }) }
the date pickers setup following jquery:
$('.date-editor').datepicker({ changemonth: true, changeyear: true, dateformat: 'yy-mm-dd', yearrange: '-100:+0', defaultdate: '', autosize: true });
how prevent textbox containing pattern? date field in ui contains following string:
dd/mm/yyy
Comments
Post a Comment