Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n2ref/control_datepicker
https://github.com/n2ref/control_datepicker
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/n2ref/control_datepicker
- Owner: n2ref
- License: mit
- Created: 2016-02-08T15:06:35.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-29T09:03:09.000Z (over 8 years ago)
- Last Synced: 2023-09-29T14:18:48.435Z (about 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Control datepicker
```html
-
$(document).ready(function(){
$('.ctrl-dpr').each(function() {
control_datepicker_range.create(this);
});
control_datepicker_range.setCallbackChange(function(date_from, date_to, wrapper) {
// Функция выполняющаяся после изменения даты
});
// Функция выполняющаяся для раскраски календаря
control_datepicker_range.setCallbackDayClass(function(date) {
var year = date.getFullYear();
var month = ('0' + (date.getMonth() + 1)).slice(-2);
var day = ('0' + (date.getDate())).slice(-2);
var myDate = year + '-' + month + '-' + day;
if (orders_edit.calendar[myDate] && orders_edit.calendar[myDate].type == 'weekend') {
return 'dp-weekend';
}
});
});```