问题标签 [bootstrap-timepicker]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
4610 浏览

javascript - need to disable input for bootstrap timepicker

I am using Bootstrap time-picker. I have successfully implemented it. But what I need is user is only able to insert in 30 min gap like: 10:00,10:30,11:00 etc. For that I have tried is minuteStep as shown below, and it works perfect.

But what is the issue is user can type time as he need. So, how to prevent it to enter time manually?

For this I have refer bootstrap timepicker

0 投票
1 回答
5345 浏览

javascript - 如何在 MVC 4 中设置时间选择器

我需要创建一个仅包含时间字段的视图。任何人都可以帮助我如何Timepicker在 MVC 4 剃须刀中创建。

这是我的代码:

模型

看法

JavaScript:

这是我的代码的结果:

时间选择器

但是当我点击时间图标时,它没有显示我想要的结果

这就是我想在我的时间选择器中做的事情

引导时间选择器

0 投票
1 回答
1068 浏览

javascript - bootstrap-timepicker input validation

Context:

I am trying to add validation on 4 different date/time pickers for an event creation tool.


The first set of date and time input is the Event Start Date/Time:

Start Date input - this date cannot be before today's date.

Start Time input - this requires no validation.


The second set of date and time input is the Event End Date/Time:

End Date Input - this cannot be before the Start Date but can be the same as the Start Date.

End Time Input - If the End Date is the same as the Start Date then the End time cannot be before the Start Time. If the End Date is after the Start Date then the End Time can be any time.


Here is the HTML:

The trick is that I don't want to the validation to happen when I click on the submit button. I want to prevent the user from inputting an invalid date/time.

I am a bit in over my head here and I don't even know where to start. Any help would be greatly appreciated!

0 投票
1 回答
1035 浏览

javascript - 从引导时间选择器获取时间值

我正在尝试从 bootstrap timepicker 获取时间价值。一个表格行中有两个表格。

第一种形式是

第二种形式是

javascript代码是

我正在尝试分别从这两种表格中获取银泰价值,并且我已经写了我尝试过的内容,但我仍然没有成功。请建议如何做到这一点。

0 投票
2 回答
4449 浏览

javascript - 设置引导时间选择器的开始时间和结束时间

我正在使用引导时间选择器,我需要它仅在上午 10 点到晚上 10 点之间显示时间。我已经检查了选项,似乎没有选项。还有其他我错过的方法吗?

0 投票
1 回答
53 浏览

bootstrap-timepicker - bootstrap-timepicker - 只获取年份和月份 - 不显示日期选择器

我使用 bootstrap-timepicker:https ://eonasdan.github.io/bootstrap-datetimepicker/#min-view-mode并使用“Min View Mode”,因为我只想得到一年和一个月。没有“天”。在他们的例子中,它工作正常。但是当我使用它时,首先选择一年,然后选择一个月,然后它就可以工作了。但是,当您更改此 val 时,它会显示一个日期选择器。

它必须显示年份或月份,但不能显示日期。

代码笔在这里: http ://codepen.io/r2get/pen/bwaZog

在第一次输入时,它首先选择年份,然后选择月份,并显示年份和月份。但是在第二次尝试(更改)时,它必须显示年份或月份,但它显示日期

0 投票
3 回答
1535 浏览

javascript - 从文本框中删除时间选择器效果

我已经看到了针对这个问题的上一个问题。但我不想用相同的 id 替换文本框。

在下拉列表中选择 Timepicker 时,timepicker应在文本框中启用(按预期运行)

当下拉值更改为文本框时,文本框应视为简单文本

现场演示

0 投票
1 回答
968 浏览

angular-ui-bootstrap - Angular Bootstrap UI Timepicker 输入无效时间

我正在使用 Angular Bootstrap UI Timepicker,如果我50在小时字段中输入,它会突出显示红色字段,但是我仍然从中得到一个看起来像这样的有效日期Tue Nov 15 2016 05:00:55 GMT+0100

有什么想法我能做什么?谢谢!

0 投票
0 回答
204 浏览

javascript - 将 Jdewit Bootstrap Timepicker 显示为内联

试用 Jdewit Bootstrap Timepicker ( http://jdewit.github.io/bootstrap-timepicker/ ),有没有办法使用它内联而不是下拉或模式?从我一直在测试的内容来看,我无法生成内联版本,这可能吗?

非常感谢所有帮助。

0 投票
2 回答
335 浏览

javascript - 日期和时间问题是取决于当地时区的对话

您好,今天我遇到了时间戳转换问题。在我的网络表单中,我使用的是引导日期选择器,用户可以在其中选择日期和时间。之后我用moment.js将这些值转换为unix 时间戳并将其传递给 PHP 页面。在 PHP 页面中,如果用户在不同的国家/地区,则该值不同,最终在数据库中插入了错误的值。因此,就像服务器时区是Latvia/Riga GMT+2而来自Georgia/Tbilisi 的用户有 GTM+4。他选择开始日期12.01.2017 15:00,Moment.js 将其传递给 PHP 页面中的开始日期的 DB 值插入12.01.2017 13:00

这是来自js的代码

之后 var 通过 ajax 传递给 PHP 脚本,例如start.unix()

在 PHP 中它接收

时间提前 2 小时收到。我该怎么做才能让用户从世界上任何地方选择时间 PHP 插入 DB,因为它选择正确,没有时区转换。