且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在角度2中设置物料日期选择器的日期格式

更新时间:2023-11-29 11:40:40

您可以使用 dateFormat 选项指定一个MMMM DD YYYY令牌,其中:

You can use dateFormat option an specify MMMM DD YYYY tokens where:

  • MMMM是名称月份
  • DD是月份中的一天
  • YYYY是年份
  • MMMM is name month
  • DD is day of the month
  • YYYY is the year

momentjs文档所述.

您的代码将如下所示:

<material-datepicker [dateFormat]="'MMMM DD YYYY'" placeholder="Select Date" [(date)]="currentDate" name="currentDate" required></material-datepicker>