jquery - MVC Razor DatePicker and TimePicker -


i have form generated razor allows users edit scheduler data, , works well.

one thing not understand, nor have seen before, date , time pickers automatically generated razor.

to clarify, these i'm talking about:

date , time pickers

they're nice , all, can see in screenshot, do not use model values.

the markup has values set in tags, controls ignore them.

here's mean:

enter image description here

as can see, values set in tags, controls not respecting values.

i note in custom-built model, have these properties annotated following:

//for dates... [datatype(system.componentmodel.dataannotations.datatype.date)]  //for time... [datatype(system.componentmodel.dataannotations.datatype.time)] 

i prefer not have remove these annotations, if affects reaching solution, must done.

to solve this, i'd 1 of 2 things:

  1. prevent these controls being generated in first place can use this absolutely wonderful jquery datetimepicker addon.
  2. force these controls respect , display values passed in model.

all suggestions appreciated. suggestions made familiar mvc appreciated more.

  1. render these using @html.textboxfor( x => x.startdate, new { @class = "date" }) , use jquery $('.date').datetimepicker(); apply query plugin.

  2. the values date , time inputs should in formats yyyy-mm-dd , hh:mm:ss - explains why aren't working currently. haven't looked @ plugin want use closely, let configure date/time formats use.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -