【问题标题】:JQ grid Date format(Month date, year) Ex- June 26, 2015JQgrid 日期格式(月日、年)Is- 2015 年 6 月 26 日
【发布时间】:2015-08-13 06:08:20
【问题描述】:

我正在使用 JQ 网格的日期格式,我得到了这个 (yyyy-mm-dd) 格式。我想将日期格式更改为 mm 日期、年份。

示例:2015 年 6 月 26 日

如果我的输入日期格式为空,那么我想显示点(...)

网格数据应该是这样的,

任务日期

2015 年 6 月 26 日
...

2015 年 7 月 26 日

【问题讨论】:

    标签: javascript jquery jquery-ui jqgrid


    【解决方案1】:

    使用时刻并指定格式。

    var dateString = '1995-12-25', formatted = '...'; 
    
    if (dateString) {
       formatted = moment(dateString).fomat('MM DD, YYYY');
    }
    

    然后在需要的地方注入格式化字符串。

    有关格式的更多信息 - http://momentjs.com/docs/#/displaying/format/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多