Calendar is a touch optimized component that provides an easy way to handle dates.
Calendar could be used as inline component or as overlay. Overlay Calendar will be automatically converted to Popover on tablets (iPad).
Create Calendar Instance
Calendar can be created and initialized only using JavaScript. We need to use related App's method:
myApp.calendar(parameters) - initialize Calendar with parameters
- parameters - object - object with Calendar parameters. Required.
- Method returns initialized Calendar instance
For example:
- var myCalendar = app.calendar({
- input: '#calendar-input'
- });
复制
Calendar Parameters
Let's look on list of all available parameters:
container | string or HTMLElement | String with CSS selector or HTMLElement where to place generated Calendar HTML. Use only for inline pickers | |
input | string or HTMLElement | String with CSS selector or HTMLElement with related input element | |
scrollToInput | boolean | true | Scroll viewport (page-content) to input when calendar opened |
inputReadOnly | boolean | true | Sets "readonly" attribute on specified input |
convertToPopover | boolean | true | Converts calendar modal to Popover on large screens (on iPad) |
onlyOnPopover | boolean | false | Enable it and Calendar will be always opened in Popover |
cssClass | string | Additional CSS class name to be set on calendar modal | |
toolbar | boolean | true | Enables calendar modal toolbar |
toolbarCloseText | string | 'Done' | Text for Done/Close toolbar button |
toolbarTemplate | string | Toolbar HTML Template. By default it is HTML string with following template:
复制
|
|
value | array | Array with initial selected dates. Each array item represents selected date | |
formatValue | function (p, values) | Function to format input value, should return new/formatted string value. values is array where each item represents selected date | |
monthNames | array | ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August' , 'September' , 'October', 'November', 'December'] | Array with full month names |
monthNamesShort | array | ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | Array with short month names |
dayNames | array | ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] | Array with week day names |
dayNamesShort | array | ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] | Array with week day short names |
updateValuesOnTouchmove | boolean | true | Updates picker and input values during touch move |
firstDay | number | 1 | First day of the week. By default 1 - Monday |
weekendDays | array | [0, 6] | Array with index numeber of weekend days, by default it is Saturday and Sunday |
dateFormat | string | 'yyyy-mm-dd' | Default date format, available expressions:
|
multiple | boolean | false | Enable to allows select multiple dates/values |
direction | string | 'horizontal' | Months layout direction, could be 'horizontal' or 'vertical' |
minDate | Date | null | Minimum allowed date |
maxDate | Date | null | Maximum allowed date |
touchmove | boolean | true | If enabled then calendar months slides follow finger during touch move |
animate | boolean | true | Enables transition between months |
closeOnSelect | boolean | false | Enable and calendar will be closed when user pick a date |
weekHeader | boolean | true | Enable week header with short name week days |
monthPicker | boolean | true | Enable month picker in toolbar |
monthPickerTemplate | string | Month picker HTML template. By default it is:
复制
|
|
yearPicker | boolean | true | Enable year picker in toolbar |
yearPickerTemplate | string | Year picker HTML template. By default it is:
复制
|
|
onChange | function (p, values, displayValues) | Callback function that will be executed when picker value changed. values anddisplayValues are arrays where each item represents value/display value of related column | |
onMonthAdd | function (p, monthContainer) | Callback function that will be executed when newly generated month HTML element will be added to calendar. | |
onDayClick | function (p, dayContainer, year, month, day) | Callback function that will be executed when user clicks/select any date | |
onMonthYearChangeStart | function (p, year, month) | Callback function that will be executed in the beginning of transition to another month/year | |
onMonthYearChangeEnd | function (p, year, month) | Callback function that will be executed in the end of transition to another month/year | |
onOpen | function (p) | Callback function that will be executed when picker is opened | |
onClose | function (p) | Callback function that will be executed when picker is closed |
Calendar Methods & Properties
After we initialize Calendar we have its initialized instance in variable (like myCalendar
variable in example above) with helpful methods and properties:
myCalendar.params | Object with passed initialization parameters |
myCalendar.value | Array where each item represents selected date |
myCalendar.opened | true if Calendar is currently opened |
myCalendar.inline | true if Calendar is inline Calendar |
myCalendar.cols | Array with specified Calendar columns. Each column also has its own methods and properties (look below) |
myCalendar.container | Dom7 instance with Calendar HTML container |
myCalendar.setValue(values) | Set new selected dates. values is array where each item represents selected date |
myCalendar.nextMonth(duration) | Calendar transition to next month for specified duration in ms |
myCalendar.prevMonth(duration) | Calendar transition to previous month for specified duration in ms |
myCalendar.nextYear() | Calendar transition to next year |
myCalendar.prevYear() | Calendar transition to previous year |
myCalendar.setYearMonth(year, month, duration) | Calendar transition to specified year, month for specified duration in ms |
myCalendar.open() | Open Calendar |
myCalendar.close() | Close Calendar |
myCalendar.destroy() | Destroy Calendar instance and remove all events |
Access to Calendar's Instance
If you initialize Calendar as inline Calendar it is possible to access to Calendar's instance from its HTML container
- var myCalendar = $$('.calenadr-inline')[0].f7Calendar;
复制
Examples
Default Setup
- <div class="content-block-title">Default setup</div>
- <div class="list-block">
- <ul>
- <li>
- <div class="item-content">
- <div class="item-inner">
- <div class="item-input">
- <input type="text" placeholder="Your birth date" readonly id="calendar-default">
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
复制
- var calendarDefault = myApp.calendar({
- input: '#calendar-default',
- });
复制
Custom Date Format
- <div class="content-block-title">Custom date format</div>
- <div class="list-block">
- <ul>
- <li>
- <div class="item-content">
- <div class="item-inner">
- <div class="item-input">
- <input type="text" placeholder="Select date" readonly id="calendar-date-format">
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
复制
- var calendarDateFormat = myApp.calendar({
- input: '#calendar-date-format',
- dateFormat: 'DD, MM dd, yyyy'
- });
复制
Multiple Values
- <div class="content-block-title">Multiple Values</div>
- <div class="list-block">
- <ul>
- <li>
- <div class="item-content">
- <div class="item-inner">
- <div class="item-input">
- <input type="text" placeholder="Select multiple dates" readonly id="calendar-multiple">
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
复制
- var calendarMultiple = myApp.calendar({
- input: '#calendar-multiple',
- dateFormat: 'M dd yyyy',
- multiple: true
- });
复制
Inline With Custom Toolbar
- <div class="content-block-title">Inline with custom toolbar</div>
- <div class="content-block">
- <div style="padding:0; margin-right:-15px; width:auto" class="content-block-inner">
- <div id="calendar-inline-container"></div>
- </div>
- </div>
复制
- var $$ = Dom7;
- var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August' , 'September' , 'October', 'November', 'December'];
- var calendarInline = myApp.calendar({
- container: '#calendar-inline-container',
- value: [new Date()],
- weekHeader: false,
- toolbarTemplate:
- '<div class="toolbar calendar-custom-toolbar">' +
- '<div class="toolbar-inner">' +
- '<div class="left">' +
- '<a href="#" class="link icon-only"><i class="icon icon-back"></i></a>' +
- '</div>' +
- '<div class="center"></div>' +
- '<div class="right">' +
- '<a href="#" class="link icon-only"><i class="icon icon-forward"></i></a>' +
- '</div>' +
- '</div>' +
- '</div>',
- onOpen: function (p) {
- $$('.calendar-custom-toolbar .center').text(monthNames[p.currentMonth] +', ' + p.currentYear);
- $$('.calendar-custom-toolbar .left .link').on('click', function () {
- calendarInline.prevMonth();
- });
- $$('.calendar-custom-toolbar .right .link').on('click', function () {
- calendarInline.nextMonth();
- });
- },
- onMonthYearChangeStart: function (p) {
- $$('.calendar-custom-toolbar .center').text(monthNames[p.currentMonth] +', ' + p.currentYear);
- }
- });
复制
相关推荐
苹果iOS是由苹果公司开发的手持设备操作系统。苹果公司最早于2007年1月9日的Macworld大会上公布这个系统,最初是设计给iPhone使用的,后来陆续套用到iPod touch、iPad以及Apple TV等苹果产品上。iOS与苹果的Mac OS X...
- 对于移动开发,iOS有UIDatePicker,Android有DatePicker,而在React Native或Flutter等跨平台框架中也有对应的插件可供使用。 4. **Calendar.rar可能包含的内容**: - 源代码:用特定编程语言(如C#、Java或...
移动应用开发中,iOS的`UIDatePicker`和Android的`DatePicker`控件也是常用的选择。 日历控件的功能并不局限于基本的日期选择。许多控件支持日期范围选择、日期格式化、日期限制(比如设定最小和最大日期)以及日期...
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
前端分析-2023071100789
基于kinect的3D人体建模C++完整代码.cpp
搞机工具箱10.1.0.7z
GRU+informer时间序列预测(Python完整源码和数据),python代码,pytorch架构,适合各种时间序列直接预测。 适合小白,注释清楚,都能看懂。功能如下: 代码基于数据集划分为训练集测试集。 1.多变量输入,单变量输出/可改多输出 2.多时间步预测,单时间步预测 3.评价指标:R方 RMSE MAE MAPE,对比图 4.数据从excel/csv文件中读取,直接替换即可。 5.结果保存到文本中,可以后续处理。 代码带数据,注释清晰,直接一键运行即可,适合新手小白。
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
基于ANSYS LSDyna的DEM-SPH-FEM耦合模拟滑坡入水动态行为研究,基于ANSYS LSDyna的DEM-SPH-FEM耦合的滑坡入水模拟分析研究,基于ansys lsdyna的滑坡入水模拟dem-sph-fem耦合 ,基于ANSYS LSDyna; 滑坡入水模拟; DEM-SPH-FEM 耦合,基于DEM-SPH-FEM耦合的ANSYS LSDyna滑坡入水模拟
auto_gptq-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
复件 复件 建设工程可行性研究合同[示范文本].doc
13考试真题最近的t64.txt
好用我已经解决报错问题
# 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!
auto_gptq-0.4.2-cp38-cp38-win_amd64.whl
自动立体库设计方案.pptx
# 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!