简体   繁体   中英

jquery datepicker format date issue

I have jquery date picker implement trough Shared/EdotorTemplates/DateTime.cshtml like this

@model DateTime
@Html.TextBox("", Model.ToString("dd.MM.yyyy"),
   new { @class = "date" })

obviously I want dd.mm.yyyy date format. Everything is ok when form is first loaded.

But, I'm getting mm/dd/yyyy format on jquery datepicker. I tried with following on _Layout.cshtml on domready with

$('.date').datepicker({ dateFormat: "dd.MM.yyyy" });

but I'm getting these strange date 11.September.20122012

How to fix these to dd.mm.yyyy format?

Thanks

像这样编辑

$('.date').datepicker({ dateFormat: "dd.mm.yy" });

$('.date').datepicker({ dateFormat: "dd.MM.yyyy" }); it will display date as 11.September.2012

$('.date').datepicker({ dateFormat: "dd/mm/yy" }); it will display date as 11/09/2012

$('.date').datepicker({ dateFormat: "dd-mm-yy" }); it will display date as 11-09-2012

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM