Using moment.js, how to display the current date format for the user?

前端 未结 2 1022
迷失自我
迷失自我 2021-01-12 09:58

Given a text field, I want to have a suitable placeholder. A typical placeholder will be something like: \"mm/dd/yyyy\".

However, I would like to use locale-aware d

2条回答
  •  灰色年华
    2021-01-12 10:37

    Follow up to Adam R's answer:

    Seems to have been exposed by now:

    localeData.longDateFormat(dateFormat);

    returns the full format of abbreviated date-time formats LT, L, LL and so on

    (source: http://momentjs.com/docs/)

    Get the currently used locale data by moment.localeData()

提交回复
热议问题