Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的应用程序中使用 ngx-datepicker,并且在日期选择器的配置中使用 'DD.MM.YYYY' 作为我的 dateInputFormat。这里我的问题是,当我手动输入格式为“YYYY.MM.DD”的日期时,输入的值更改为“DD.MM.YYYY”。不仅是格式,还有输入的日期值。例如,如果我输入 2019.04.25,它将更改为 20.04.2025,而不是显示无效日期。如何解决这个问题?
您可以使用如下配置参数:
[bsConfig]="{ dateInputFormat: 'YYYY.MM.DD'}"
在此处查看文档以获取详细信息。