【问题标题】:Kendo UI Grid Filter asp.net change date formatKendo UI Grid Filter asp.net 更改日期格式
【发布时间】:2016-04-27 08:31:27
【问题描述】:

如何更改剑道网格过滤器中的日期格式?

其实我有一个FilterableOperatorsBuilder ForDate,但是不知道怎么解决。我总是在过滤日期选择器中得到 01/04/2016 作为日期,但我需要 2016-04-01。

这是我到目前为止所拥有的:

 public static Action<GridFilterableSettingsBuilder> FilterSettings()
    {
        Action<GridFilterableSettingsBuilder> configurator = ftb =>
        {
            ftb.Mode(GridFilterMode.Menu);
            ftb.Extra(false).Operators(o => o.ForString(str => str
                    .Clear()
                    .Contains("Contains")
                    .IsEqualTo("Is equal to")
                    .IsNotEqualTo("Is not equal to")
                    .StartsWith("Starts with")
                    .EndsWith("Ends with")));

            ftb.Extra(false).Operators(o => o.ForDate(
          --->> I think ii need to change the date format right here?
         ));
        };

        return configurator;
    }

如果有人可以给我提示,那就太好了。

【问题讨论】:

    标签: asp.net-mvc kendo-ui grid


    【解决方案1】:

    好的,最后,有一个非常简单的解决方案:

    我刚刚加了

     .Format("{0:yyyy-MM-dd hh:mm:ss tt}").Filterable(f => f.UI("DateTimeFilter"))
    

    这很好用,即使它可能不是完美的解决方案。如果有人有更好的,请告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多