Skip to content

Commit

Permalink
JS-bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Feb 10, 2017
1 parent 4fde13f commit 6bc0c30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/script/frontendjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,18 +356,18 @@ var eduBookingView = {

var date = new Date();
var year = RegExp.$1, month = (RegExp.$2 - 1), day = RegExp.$3, unique = RegExp.$4;
if(year.length <= 2) {
if(year.toString().length <= 2) {
year = date.getFullYear().toString().substring(0, 2) + '' + year;
while(year > date.getFullYear()) year -= 100;
}

var checkDate = new Date(year, month, day);
if(Object.prototype.toString.call(checkDate) !== '[object Date]' || isNaN(checkDate.getTime())) return false;

if(month.length == 1) {
if(month.toString().length == 1) {
month = '0' + (month + 1);
} else {
month = month + 1
month = (month + 1);
}

if(day.length == 1) {
Expand Down

0 comments on commit 6bc0c30

Please sign in to comment.