jquery中如何设置时间?
我是网络开发新手。 我有一些输入表单。我正在使用 jquery 1.4.2
其中我有一个专门用于输入时间的文本字段。 我希望每个人都不需要手动打字。 并且也让每个用户都可以轻松使用。 你能告诉我该怎么做吗?
i'm newbie at web developing.
i have some input form.i'm using jquery 1.4.2
inside that i have one textfield specially for input time.
i want every one no need to type manually.
and also make easy for every user.
can you tell me how do i do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用日期对象。请参阅 ECMAScript 标准了解更多信息。
Use the Date Object. See "15.9.2 The Date Constructor Called as a Function" in the ECMAScript standard for more info.
在你的 HTML 中说你有:
然后你可以设置它:
Say in your HTML you have:
Then you can set it with:
听起来您正在寻求一种更好的 UI 方式来解决此问题。那里有比时间小部件更多的日期,但是有可用的时间选择器,我个人最喜欢的是这里:jQuery.timepicker,看看吧。
它是 jquery UI 主题,如果您需要更具体的时间,您仍然可以在框中键入,因此它是双向的:)
It sounds like you're after a better UI way to go about this. There are many more date than time widgets out there, but there are time pickers available, my personal favorite is this here: jQuery.timepicker, give it a look.
It's jquery UI Themeable, and if you need a more specific time you can still type in the box, so it works both ways :)