You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

UIKit TimePicker如何显示08:00至22:00指定时段?

Fix UIKit TimePicker Not Displaying 22:00 with start:8, end:22

I’ve run into this exact quirk with UIKit v2’s TimePicker before—let’s get your full 08:00 to 22:00 range working properly.

The Root Cause

UIKit v2’s TimePicker treats the end parameter as exclusive: when you set end:22, it stops generating time options at 21:00 instead of including 22:00. That’s why your 22:00 option is missing.

Simple Fix: Adjust the end Value

To include 22:00 in your time range, just set the end parameter to 23 instead. Here’s your updated configuration:

data-uk-timepicker="{start:8, end:23}"

This will make the picker generate every hour from 08:00 all the way through 22:00.

Double-Check Initialization (If Needed)

If the fix above doesn’t take effect right away, confirm that:

  • You’ve included the official UIKit v2 JavaScript file in your project (and it loads after your time picker element).
  • There are no typos in your data-uk-timepicker attribute syntax (curly braces, commas, and numbers should all be correctly formatted).

Once you update the end value, refresh your page and you’ll see 22:00 show up in the time picker dropdown.

内容的提问来源于stack exchange,提问作者kupang lie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:37:54