javascript - Two dates combination showing as shortdate in textbox in mvc -


i have partial view has value of startdate -enddate.

i have startdate , enddate properties in model datetime. when data coming webapi binding time. need 01/01/2015 - 30/12/2015. displaying 01/01/2015 12:00:00 30/12/2015 12:00:00 am.

can me

try:

@item.date.tostring("dd mmm yyyy") 

or use [displayformat] attribute on view model:

[displayformat(dataformatstring = "{0:dd mmm yyyy}")] public datetime date { get; set } 

and in view:

@html.displayfor(x => x.date) 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -