更改 Datetimepicker 中的日期格式

发布于 2024-12-26 13:27:47 字数 458 浏览 3 评论 0原文

我需要更改以下代码以更改以下 javascript 中 datetimepicker 的日期格式:

http://www.google.com/codesearch#ak3vw-ODLck/packages/jQuery.UI.Combined.1.8.11/Content/Scripts/jquery-ui-1.8.11.js&q= jquery-ui-1.8.11.js&type=cs

目前它显示为 dd/mm/yyyy hh:mm:ss

但我想要它日/月/年

Where i need to change in the below code to change date format for datetimepicker in the following javascript:

http://www.google.com/codesearch#ak3vw-ODLck/packages/jQuery.UI.Combined.1.8.11/Content/Scripts/jquery-ui-1.8.11.js&q=jquery-ui-1.8.11.js&type=cs

Curently its show as dd/mm/yyyy hh:mm:ss

But i want it to be dd/mm/yyyy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

£烟消云散 2025-01-02 13:27:47

您可以在调用 datetimepicker 控件时设置格式,而不是在 JQuery 库中进行更改。

var date = $('#datepicker').datepicker({ dateFormat: 'dd/mm/yyyy' });

如果有您只想在 lib 中执行此操作,请参阅这一行要更改

dateFormat: 'mm/dd/yy', // See format options on parseDate

您需要将此值设置为您想要的任何值。即日期格式:'dd/mm/yyyy'

Rather than changing in JQuery lib you can set the format while you call the datetimepicker control.

var date = $('#datepicker').datepicker({ dateFormat: 'dd/mm/yyyy' });

If at all you want to do it in lib only then See this line to change

dateFormat: 'mm/dd/yy', // See format options on parseDate

You need to set this value to whatever you want. i.e. dateFormat: 'dd/mm/yyyy'

雪落纷纷 2025-01-02 13:27:47

描述

您可以使用选项dateformat 更改标准 jQuery UI DatePicker 中的日期格式。

您不需要更改插件。

示例

$( "#MyDatePicker" ).datepicker({ dateFormat: 'dd/mm/yyyy' });

更多信息

Description

You can change the date format in the standard jQuery UI DatePicker using the option dateformat.

You dont need to change the plugin.

Sample

$( "#MyDatePicker" ).datepicker({ dateFormat: 'dd/mm/yyyy' });

More Information

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文