可定制的JS期與時間選擇器:Rome
Rome是一個可定制的JS日期與時間選擇器。不依賴于第三方庫。
創建 Rome 日歷有一堆的選項可以用。這些選項具有合理的默認值,很容易調整。這些選項在下面列出。
Option | Description | </tr> </thead>|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
appendTo |
DOM element where the calendar will be appended to. Takes 'parent' as the parent element |
</tr>
|||||||||||||||||||||||||
autoClose |
Closes the calendar when picking a day or a time | </tr>|||||||||||||||||||||||||
autoHideOnBlur |
Hides the calendar when focusing something other than the input field | </tr>|||||||||||||||||||||||||
autoHideOnClick |
Hides the calendar when clicking away | </tr>|||||||||||||||||||||||||
date |
The calendar shows days and allows you to navigate between months | </tr>|||||||||||||||||||||||||
dateValidator |
Function to validate that a given date is considered valid. Receives a native Date parameter. |
</tr>
|||||||||||||||||||||||||
dayFormat |
Format string used to display days on the calendar | </tr>|||||||||||||||||||||||||
initialValue |
Value used to initialize calendar. Takes string , Date , or moment |
</tr>
|||||||||||||||||||||||||
inputFormat |
Format string used for the input field as well as the results of rome |
</tr>
|||||||||||||||||||||||||
invalidate |
Ensures the date is valid when the field is blurred | </tr>|||||||||||||||||||||||||
max |
Disallow dates past max . Takes string , Date , or moment |
</tr>
|||||||||||||||||||||||||
min |
Disallow dates before min . Takes string , Date , or moment |
</tr>
|||||||||||||||||||||||||
monthFormat |
Format string used by the calendar to display months and their year | </tr>|||||||||||||||||||||||||
required |
Is the field required or do you allow empty values? | </tr>|||||||||||||||||||||||||
styles |
CSS classes applied to elements on the calendar | </tr>|||||||||||||||||||||||||
time |
The calendar shows the current time and allows you to change it using a dropdown | </tr>|||||||||||||||||||||||||
timeFormat |
Format string used to display the time on the calendar | </tr>|||||||||||||||||||||||||
timeInterval |
Seconds between each option in the time dropdown | </tr>|||||||||||||||||||||||||
timeValidator |
Function to validate that a given time is considered valid. Receives a native Date parameter. |
</tr>
|||||||||||||||||||||||||
weekStart |
Day considered the first of the week. Range: Sunday 0 - Saturday 6 |
</tr>
</tbody>
</table>