gpt4 book ai didi

jquery-ui - 在 jQuery UI datepicker 中删除日期和月份中的前导 "0"

转载 作者:行者123 更新时间:2023-12-04 14:15:20 24 4
gpt4 key购买 nike

我的问题类似于 Remove Leading "0" in day of month SimpleDateFormat

是否可以删除 jquery UI datepicker 中的前导“0”?

DateFormat option尽可能接近我从文档中获得的信息:

$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });

但我需要的是像 2012 年 12 月 5 日这样的日期,datepicker 将其显示为 12/05/2012,而我想要 12/5/2012。 4 月 5 日也是如此:例如 4/5/2013。

这可以在没有广泛逻辑的情况下完成吗?

最佳答案

尝试

$( ".selector").datepicker({ dateFormat: "yy-m-d"});

来源:Jquery DateFormats

关于jquery-ui - 在 jQuery UI datepicker 中删除日期和月份中的前导 "0",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13966273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com