Format Moment.js am/pm to include periods/dots

前端 未结 4 1086
再見小時候
再見小時候 2021-01-25 13:56

I\'m running into a small formatting issue with moment\'s a input.

a/A will return AM/am PM/pm but is there a way to format this to include periods?

<
4条回答
  •  臣服心动
    2021-01-25 13:58

    Based on @user4040648 answer here is how you can implement it in es6

        moment.updateLocale('en', {
          meridiem(hour, minute, isLowerCase) {
              return hour < 12 ? 'a.m.' : 'p.m.';
          }
        });
    

提交回复
热议问题