diff --git a/dist/persian-date.js b/dist/persian-date.js index 7e20afe..474823c 100644 --- a/dist/persian-date.js +++ b/dist/persian-date.js @@ -1,6 +1,6 @@ /*! * - * persian-date - 0.2.3 + * persian-date - 0.2.4 * Reza Babakhani * http://babakhani.github.io/PersianWebToolkit/docs/persian-date/ * Under WTFPL license @@ -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; diff --git a/src/algorithms.js b/src/algorithms.js index e543628..bddd996 100644 --- a/src/algorithms.js +++ b/src/algorithms.js @@ -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; } diff --git a/test/test.js b/test/test.js index 6819299..9777dba 100644 --- a/test/test.js +++ b/test/test.js @@ -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];