猿问

时刻获取时间段 AM//PM 本地化

我们是否有类似moment.weekdays()或moment.months()将返回 AM PM 本地化的函数?像moment.period()什么?


timeFormatDefaultLocale({

    "dateTime": "%A, der %e. %B %Y, %X",

    "date": "%d.%m.%Y",

    "time": "%H:%M:%S",

    "periods": ["AM", "PM"], <------ I need to pass moment function to get period

    "days":  moment.weekdays() as any,

    "shortDays": moment.weekdaysShort() as any,

    "months": moment.months() as any,

    "shortMonths": moment.monthsShort() as any

});


凤凰求蛊
浏览 161回答 2
2回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答