Angular Bootstrap: 如何允许两种不同的日期格式
Angular Bootstrap: How to Allow 2 different date format
我正在尝试允许 MM/dd/YYYY 或 M/d/YYYY.
或者这个模式:
02/04/1998
02/4/1998
2/04/1998
2/4/1998
根据 Angular UI Bootstrap datepicker documentation, the directive uses the date filter built into angular core (documentation here).
根据您想要的格式,您需要 MM
作为 format-month
属性,dd
作为 format-day
属性。
此问题似乎已解决 commit. You can now define a day/month/year-date in format d!.M!.yyyy
. It allows an optional leading zero for day and month. See this github-issue 以获取更多信息。
从 V1.0 开始作为 NPM (angular-ui-bootstrap) 提供。
我正在尝试允许 MM/dd/YYYY 或 M/d/YYYY.
或者这个模式:
02/04/1998
02/4/1998
2/04/1998
2/4/1998
根据 Angular UI Bootstrap datepicker documentation, the directive uses the date filter built into angular core (documentation here).
根据您想要的格式,您需要 MM
作为 format-month
属性,dd
作为 format-day
属性。
此问题似乎已解决 commit. You can now define a day/month/year-date in format d!.M!.yyyy
. It allows an optional leading zero for day and month. See this github-issue 以获取更多信息。
从 V1.0 开始作为 NPM (angular-ui-bootstrap) 提供。