Jquery 插件 - 日期选择器和 CRUD(php mysql)

发布于 2024-09-07 12:24:10 字数 533 浏览 3 评论 0原文

我正在尝试找到一个日期选择器,它可以显示日期以选择开始当前日期,以便用户不会选择过去的日期,并且我不必担心验证。我不确定这是否会显示来自任何地方的任何人的正确日期。我找到了一些插件,但没有一个有这个选项。

我发现这个 http://jqueryui.com/demos/datepicker/#min-max 但限制范围选项从当前日期之前的 10-15 天开始。我期望日期格式为 2010-06-28,因为我在网站上的其他代码基于此格式工作。

我正在尝试使用这些选项找到 php/mysql/jquery crud 的最佳示例 用户登录后,我想显示他/她当前的项目列表,其中包含“删除项目、更新/修改项目、添加新项目”。我有一个“添加新项目”页面,以便用户可以导航到该页面,他可以通过填写名称、日期和一些更多信息来添加新项目,

下发布询问信息的问题,请帮助我。

如果我无法在不提供任何代码示例的情况

I am trying to find a date picker that can show dates to select starting current date so that the users don't select the past date and I need not worry about validating. I am not sure if this will show the correct date for any one from any place. I found some plugins but none of it has this option.

I found this http://jqueryui.com/demos/datepicker/#min-max but the restrict range option starts with 10-15 days before current date. I am expecting the date format to be 2010-06-28 as I have my other code on the site works based on this format.

I am trying to find a best example for php/mysql/jquery crud with these options
After a user logs in, I want to show his/her current list of items with "delete item, update/modify item, add a new item. I have a page for the "add new item" so the user can be navigated to that page and he can add a new item by filling a name, date and some more info.

Please help me out. Sorry if I cannot post questions asking for info without giving any code examples.

regards

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

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

发布评论

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

评论(1

ゝ偶尔ゞ 2024-09-14 12:24:10

您提到的 jQueryUI datepicker 将执行您需要的操作。使用以下选项设置实例的选项:

$(document).ready(function() {
    $("#datepicker").datepicker({
        minDate: +0,
        dateFormat: 'yy-mm-dd'
    });
});

这将从今天开始日期选项,并按照您指定的所需格式设置日期格式。您所需要做的就是通过为输入字段设置正确的 ID 来确保选择器正确。

The jQueryUI datepicker that you mentioned will do what you need it to. Set the options for the instance using the options below:

$(document).ready(function() {
    $("#datepicker").datepicker({
        minDate: +0,
        dateFormat: 'yy-mm-dd'
    });
});

This will start the date options with today and format the date as you specified the format needed to be. All you need to do is make sure the selector is correct by setting the correct ID for the input field.

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