jQuery datepicker's dateFormat - how to integrate with .NET current culture DateTimeFormat

前端 未结 3 1077
半阙折子戏
半阙折子戏 2020-12-18 05:34

I\'m using jQuery\'s datepicker plugin in .NET ASP MVC3 intranet application. User that use application have offices in different countries and different locale. This is why

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 05:45

    The codeproject article JQueryUI Datepicker in ASP.NET MVC http://www.codeproject.com/Articles/62031/JQueryUI-Datepicker-in-ASP-NET-MVC has function that does exactly what you wanted

        /// Converts the .net supported date format current culture 
    /// format into JQuery Datepicker format.
    /// 
    /// HtmlHelper object.
    /// Date format supported by .NET.
    /// Format string that supported in JQuery Datepicker.
    public static string ConvertDateFormat(this HtmlHelper html, string format)
    

    I've also posted a function that does the opposite-Translate jQuery UI Datepicker format to .Net Date format

提交回复
热议问题