Skip to content

Commit

Permalink
fix #37
Browse files Browse the repository at this point in the history
  • Loading branch information
babakhani committed Sep 2, 2017
1 parent 0447112 commit 2ee1e3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/persian-date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
*
* persian-date - 0.2.3
* persian-date - 0.2.4
* Reza Babakhani <[email protected]>
* http://babakhani.github.io/PersianWebToolkit/docs/persian-date/
* Under WTFPL license
Expand Down Expand Up @@ -510,7 +510,7 @@ var PersianDateClass = function () {
this.gDate = new Date();
}
this.pDate = this.algorithms.toPersianDate(this.gDate);
this.version = "0.2.3";
this.version = "0.2.4";
this.formatPersian = '_default';
this._utcMode = false;
return this;
Expand Down
9 changes: 1 addition & 8 deletions src/algorithms.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,7 @@ class Algorithms {
}
// Howha : javascript Cant Parse this array truly 2011,2,20
let pd = this.calcPersian(parray[0], parray[1], parray[2]),
gDate = new Date();
gDate.setYear(pd[0]);
gDate.setMonth(pd[1]);
gDate.setDate(pd[2]);
gDate.setHours(parray[3] ? parray[3] : 0);
gDate.setMinutes(parray[4] ? parray[4] : 0);
gDate.setSeconds(parray[5] ? parray[5] : 0);
gDate.setMilliseconds(parray[6] ? parray[6] : 0);
gDate = new Date(pd[0], pd[1], pd[2], parray[3] ? parray[3] : 0, parray[4] ? parray[4] : 0, parray[5] ? parray[5] : 0, parray[6] ? parray[6] : 0);
return gDate;
}

Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*global describe,it*/
let assert = require('assert');
let expect = require('chai').expect;
let obj = require('../dist/persian-date.min.js');
let obj = require('../dist/persian-date.js');
const pDate = obj,
Duration = new pDate().duration,
defaultArray = [1391, 1, 1, 1, 1, 1, 1];
Expand Down

0 comments on commit 2ee1e3a

Please sign in to comment.