【问题标题】:How to display the time in 24-hour format in timeCellComponent using <dx-scheduler>如何使用 <dx-scheduler> 在 timeCellComponent 中以 24 小时格式显示时间
【发布时间】:2021-06-18 18:31:19
【问题描述】:

我有像“下午 2:00”这样的时间,我想像“14:00”这样得到它。谁能帮帮我?

【问题讨论】:

    标签: angular devextreme


    【解决方案1】:

    参考这篇帖子https://supportcenter.devexpress.com/ticket/details/t495138/dxscheduler-how-to-show-a-time-scale-in-the-24-hour-format#这是2年前的,例如有一些解决方法

    timeCellTemplate={e =>new Date(e.date).toLocaleString("en-GB", {hour: "2-digit", minute: "2-digit"})}
    

    支持团队也在这里提供了一些使用本地化的示例

    https://js.devexpress.com/Demos/WidgetsGallery/Demo/Localization/UsingIntl/Angular/Light/

    希望这能回答你的问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 2013-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多