Skip to content

Commit 13c66d7

Browse files
committed
Added in prototype Date method getCountDaysInMonth for less depend with date-parse library
1 parent 83206a7 commit 13c66d7

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"datetimepicker",
3-
"version":"2.2.7",
3+
"version":"2.2.8",
44
"main": [
55
"jquery.datetimepicker.js",
66
"jquery.datetimepicker.css"

datetimepicker.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "datetimepicker",
3-
"version": "2.2.7",
3+
"version": "2.2.8",
44
"title": "jQuery Date and Time picker",
55
"description": "jQuery plugin for date, time, or datetime manipulation in form",
66
"keywords": [

jquery.datetimepicker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @preserve jQuery DateTimePicker plugin v2.2.7
2+
* @preserve jQuery DateTimePicker plugin v2.2.8
33
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
44
* (c) 2014, Chupurnov Valeriy.
55
*/
@@ -242,6 +242,10 @@
242242
}
243243
};
244244

245+
Date.prototype.countDaysInMonth = function(){
246+
return new Date(this.getFullYear(), this.getMonth()+1, 0).getDate();
247+
};
248+
245249
$.fn.xdsoftScroller = function( _percent ) {
246250
return this.each(function() {
247251
var timeboxparent = $(this);
@@ -879,7 +883,7 @@
879883

880884
var d,y,m,classes = [];
881885

882-
while( i<_xdsoft_datetime.currentTime.getDaysInMonth()||start.getDay()!=options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()==start.getMonth() ) {
886+
while( i<_xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!=options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()==start.getMonth() ) {
883887
classes = [];
884888
i++;
885889

0 commit comments

Comments
 (0)