Skip to content

Commit d5543cf

Browse files
authored
Merge pull request #2 from MatteoBax/develop
Bug fixes
2 parents 1e2dba7 + 7f352aa commit d5543cf

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

date.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let bisestile = false;
22
let gmax = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
33
function controlloBisestile(anno){
44
let x = anno%100;
5-
if((anno%4)==0 & x!=0){
5+
if((anno%4)==0 && x!=0){
66
bisestile = true;
77
}else{
88
if((anno%400)==0){
@@ -63,10 +63,10 @@ exports.checkDate = function(date,format) {
6363
//Controllo validità giorni
6464
if(gg <= gmax[mm-1]){
6565
//Controllo validità mesi
66-
if(mm>=1 & mm<=12 & mm.length == 2){
66+
if(mm>=1 & mm<=12 && mm.length == 2){
6767
//Controllo validità anni
68-
if(yyyy>=0 & yyyy.length == 4){
69-
if(splitted.length==3){
68+
if(yyyy>=0 && yyyy.length == 4){
69+
if(splitted.length == 3){
7070
return 0;
7171
} else{
7272
return -1;

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@matteobax/date-convalidator",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Check the validity of the date",
55
"main": "date.js",
66
"scripts": {
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "git+https://github.com/MatteoBax/date-convalidator.git"
1212
},
13-
"keywords":[
13+
"keywords": [
1414
"date",
1515
"check date"
1616
],

0 commit comments

Comments
 (0)