calendar-tools
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -114,3 +114,3 @@ var today = new Date() | ||
// creates Recurrence object | ||
var Recurrence = new Carilu.Recurrence(events); | ||
var Recurrence = new caTools.Recurrence(events); | ||
@@ -117,0 +117,0 @@ var instances = []; |
316
History.md
@@ -0,25 +1,31 @@ | ||
0.1.6 / 2011-11-11 | ||
================== | ||
n.n.n / 2011-11-05 | ||
* finally renames Carilu by caTools | ||
* updates tests | ||
0.1.5 / 2011-11-10 | ||
================= | ||
= | ||
* fix version number | ||
* Expose 'util'. | ||
0.1.4 / 2011-11-07 | ||
================== | ||
* removing gh-pages | ||
* Fix package.json 'main' field. | ||
* Renamed index to lib/calendar-tools | ||
* Added expresso as a developer dependency. | ||
0.1.3 / 2011-11-05 | ||
================== | ||
* add default recurrence values | ||
* mixing | ||
* exporting index.js | ||
* deete old example | ||
* fire by burn | ||
* renaming full calendar example | ||
* commiting | ||
* minor improvement in applyTXCorrection() | ||
* reverting | ||
* apply tz correction weekly mode | ||
* add dylight correction in getElapsedInstance() | ||
* cleaning | ||
* minor refact in clone() | ||
* use applyTZCorrection() in date next jump | ||
* git add gitDiff(), getTZDiff() and applyTZCorrection() | ||
* Dylight correction when a new instance is cloned | ||
* fix syntax bug | ||
n.n.n / 2011-11-03 | ||
0.1.2 / 2011-11-03 | ||
================== | ||
@@ -30,5 +36,2 @@ | ||
* fix recurrence montly - day of week. | ||
* cleaning | ||
* error text correction | ||
* getDiff(). Tests passed | ||
* add getDiff() method. | ||
@@ -38,245 +41,76 @@ * add defined recurrence condition when an instance is cloned | ||
n.n.n / 2011-11-02 | ||
0.1.1 / 2011-11-02 | ||
================== | ||
* 0.1.1 | ||
* monthly - day of week. add date control when date number not exists in the next month | ||
* monthly - day of week. add date control when date number not exists in the next month | ||
* monthly - day of week. date control when date number not exists in the next month | ||
* getDaysInMonth accept Date parameter | ||
* fix minutes difference | ||
* generates Date object when an instances is cloned | ||
* fix diffInDays - Daylight saving time fucking nightmare | ||
* add tests for getDiffInDays() | ||
* add getDiffInDays() - Daylight saving time nightmare | ||
* computing end-by on into getCountdown() method | ||
* add one day to end-by on date | ||
* roundind diff in days because of Daylight_saving_time | ||
* remove properties using proto. Store seed object using Instance property | ||
* no use parseISO8601 in noralize() event | ||
* fix isLast() Instance method | ||
* 0.1.0 | ||
* test | ||
* milliseconds correction | ||
* normalize(). on end-by control. | ||
* Daylight saving time nightmare correction | ||
n.n.n / 2011-10-31 | ||
0.1.1 / 2011-10-31 | ||
================== | ||
* add test for getPrev() | ||
* remove getPrevious() proto. add getPrev() | ||
* add test for instance number | ||
* refact Instance getters() | ||
* add test for getNumber() instance. Not passed | ||
* Merge branch 'master' of github.com:LearnBoost/Carilu | ||
* remoce fullCalendar remote submodule | ||
* store previous instance | ||
* wtf | ||
* fix npm package syntax error | ||
* Update Readme.md | ||
n.n.n / 2011-10-31 | ||
0.1.0 / 2011-10-31 | ||
================== | ||
* add client-side fullcalendar example | ||
* add client-side fullcalendar example | ||
* fix getDateNextJump() for allDay seed events | ||
* filter for all-day seed events. Tests passed. | ||
* filter for all-day seed events | ||
* normalize() - remove all-day correction | ||
* weekly - avoid falling into the void. test passed | ||
* weekly - avoid falling into the void | ||
* minor improvement in walk | ||
* return [] for no recurrence events | ||
* refact getDateInstance - monthly mode | ||
* update monthly tests | ||
* fix period bug in getInstances() | ||
* cleaning | ||
* getInstances() accepts start, end period dates | ||
* working on exmaples | ||
* Merge branch 'master' of github.com:LearnBoost/Carilu | ||
* remove collection | ||
* Update Readme.md | ||
* minors | ||
* doc | ||
* add example, API doc, etc | ||
n.n.n / 2011-10-31 | ||
0.0.9 / 2011-10-31 | ||
================== | ||
* add client-side fullcalendar example | ||
* add client-side fullcalendar example | ||
* fix getDateNextJump() for allDay seed events | ||
* filter for all-day seed events. Tests passed. | ||
* filter for all-day seed events | ||
* normalize() - remove all-day correction | ||
* weekly - avoid falling into the void. test passed | ||
* weekly - avoid falling into the void | ||
* minor improvement in walk | ||
* return [] for no recurrence events | ||
* refact getDateInstance - monthly mode | ||
* update monthly tests | ||
* fix period bug in getInstances() | ||
* cleaning | ||
* getInstances() accepts start, end period dates | ||
* working on exmaples | ||
* Merge branch 'master' of github.com:LearnBoost/Carilu | ||
* remove collection | ||
* Update Readme.md | ||
* minors | ||
* doc | ||
* add example, API doc, etc | ||
n.n.n / 2011-10-28 | ||
0.0.8 / 2011-10-28 | ||
================== | ||
* update nodejs exmaple | ||
* add getSeed() method wtf | ||
* add getSeed() method | ||
* .get() not is user never more | ||
* remove obsolete .get() method | ||
* fixing getting methods | ||
* hidding properties through protos | ||
* addNoRec condition | ||
n.n.n / 2011-10-28 | ||
0.0.7 / 2011-10-28 | ||
================== | ||
* collection | ||
* add collection property | ||
* update nodejs example | ||
* integrate seed class with integrate | ||
* integrate Seed class with Instance | ||
* add instance.js class | ||
n.n.n / 2011-10-28 | ||
0.0.6 / 2011-10-28 | ||
================== | ||
* 0.0.5 | ||
* timezone: add systemTZCorrection and offsetCorrection | ||
* timezone: add systemTZCorrection and offsetCorrection | ||
* fixed syntax error in package.js | ||
* ignoring npm-debug.log | ||
n.n.n / 2011-10-28 | ||
0.0.5 / 2011-10-28 | ||
================== | ||
* 0.0.4 | ||
* no-recurrence events setting by options param | ||
* add test for no-recurrence event | ||
* process no-recurrence events | ||
* updated nodejs exmaple | ||
* add nodejs exmaple | ||
* add error exception to Seed constructor | ||
* Readming | ||
n.n.n / 2011-10-27 | ||
0.0.4 / 2011-10-27 | ||
================== | ||
* 0.0.3 | ||
* cleaning - remove timezone from seed.js | ||
* yearly - getElapsedInstances() | ||
* yearly - getNextDateInstance() | ||
* yearly - getPrevDateInstance() | ||
* add getDiffInYears() | ||
* getInstances() for monthly - day of week | ||
* elapsedEvents for monthly - day of week | ||
* improvemenet monthly - day of week | ||
* monthly - day-on-week done | ||
* normalize | ||
* monthly - day of month - getDateNextInstance() tests passed | ||
* monthly - day of month - getDateNextInstance() | ||
* monthly - day of month - getDatePrevInstance() tests passed | ||
* monthly - day of month | ||
* depuring para todos | ||
* alto refac lpqlp | ||
* elased events for monthly - day on month recurrence - tests passed | ||
* elased events for monthly - day on month recurrence | ||
* add getDiffInMonths() Util function | ||
* monthly - day on month - add tests | ||
* passed tests for getDateInstance() - monthly - day on month | ||
* minor improvement in getFormattedTime() function | ||
* computing getDateInstance() for month - day on month recurrence type | ||
* add test for isLeapYear() | ||
* add isLeapYear() and getDateInMonth() date functions | ||
* remove lib/index.js | ||
* rename test file | ||
* improvements tests | ||
* remove shit code from util.js | ||
* add several tests for getFormattedTime() | ||
* add getFormattedTime() date function() | ||
* fixed worng ISO8601 call | ||
* add missed line WTF | ||
* client-side. Building Calendar global object | ||
* client-side: export recurrence module like Recurrence property of Carilu global namescape | ||
* Carilu integration - add module, alias in calevent object | ||
* exports modules through index. Expose Util module | ||
* getting instances - weeklyw | ||
* getting instances - daily - on - tests passed | ||
* getting instances - daily - after - tests passed | ||
* getting isntances - daily - tests passed | ||
* fixing ellapsed events weekly mode | ||
* seed: getDateInstance() cleaning and minor improvement. | ||
* weekly: prev/next date instance. passed tests | ||
* getDatePrevDate() for weekly recurrence | ||
* renaming | ||
* remove duration functions | ||
* remove event {} usefull method from Util | ||
* alto refact | ||
* #2, #6 - add new seedjs file. cleaning | ||
* BIG BIG Refact | ||
* #2, #6 refact - add normalizePeriod private function | ||
* #2, #6 refact - add walkWeek private functionw | ||
* #2, #6 refact - elapsedInstances() - weekly - all tests passed | ||
* #2, #6 refcat: elapsedInstances - weekly | ||
* add thes for weekly jumping vector | ||
* texts in tests | ||
* recurrenece: git counting bug in getCountdown() | ||
* util: improvemenet in getElapsedEvents() | ||
* Merge branch 'gh-pages' of github.com:LearnBoost/Carilu | ||
* Initial commit | ||
* #2, #6: recurrence - refact. daily - on - test passed | ||
* #2, #6: recurrence - refact. daily - never - test passed | ||
* #2, #6: recurrence - refact. daily - after - test #3 passed | ||
* #2, #6: recurrence - refact. daily - after - test #2 passed | ||
* #2, #6: recurrence - refact. daily - test #1 passed | ||
* #2, #6: recurrence - refact. daily | ||
* cleaning console | ||
* tests for getElapsedInstances() adding partials instances passed | ||
* improvemenet getElapsedInstances() function | ||
* add addPartialInstance parameter to getElapsedInstances() method | ||
* #2, #6 - removign old code. Add getCountdown() provate function | ||
* fix #1 bug | ||
* #1 - getElapsedInstances() - allDay tests passed | ||
* #1 - getElapsedInstances() - edges corrections | ||
* #1 - getElapsedInstances() - add allday correction | ||
* add clearTime() clonning date test | ||
* removign old code. Add getCountdown() | ||
* add/testing getElapsedInstances() | ||
* clearTime() clone supported | ||
* clearTime(): add boolean clone option | ||
* #1 - update getElapsedInstances() tests | ||
* #1 getElapsedInstances()- no modify date edges | ||
n.n.n / 2011-10-21 | ||
0.0.3 / 2011-10-21 | ||
================== | ||
* cleaning | ||
* removing, ckeaning, etc tests | ||
* refac: add string tests | ||
* calen is officially killed | ||
* atom: doc | ||
* Atom: add genEvent() tests | ||
* RFC2445: remove atom tests | ||
* atom: genEvent() | ||
* atom: rename to genEvent() method | ||
* RFC2445 refact: add atom lib | ||
* RFC2445 refact: remove tests | ||
* RFC2445 refact: remove objEventToAtom() function from calen | ||
* RFC2445 refact: all genRecurrenceString() tests passed | ||
* RFC2445 refact: doc in genRecurrenceString | ||
* RFC2445 refact: rename getRecurrenceXML by genRecurrenceString | ||
* RFC2445 refact: all getRecurrencObt() tests passed | ||
* RFC2445 refact: rename getObject() to getRecurrenceObj() | ||
* RFC2445 refact: remove getFrequency() tests from calen | ||
* RFC2445 refact: remove getObject() function | ||
* RFC2445 refact: getAllDay() test | ||
* RFC2445 refact: getAllDay() | ||
* RFC2445 refact: remove tests form calen.test | ||
* RFC2445 refact: remove getAllday function | ||
@@ -287,95 +121,19 @@ * RFC2445 refact: getFrequency() tests passed | ||
* refact: add rfc2445.js new lib file. | ||
* change label test | ||
* remove parseDate = {} | ||
* refact:parse date test passed | ||
* remove time module | ||
* refact: fixed naming bug | ||
* rename Alias | ||
* refact: moving usefull parsing date functions from calen to util | ||
* refact: moving usefull string function from calen to util | ||
* testing - add _print() like module | ||
* main: add new tests file. | ||
* rename lib main file to index.js | ||
* npm: not private module | ||
* util: require just util modele | ||
* not export util module | ||
* .. | ||
* util: add daysMap to date constants | ||
* recurrence: normalized lib | ||
* recurrence: nromalized all tests | ||
* util: exports date constants | ||
* util: rename getEventDuration() by getDuration() | ||
* cleaning util tests | ||
* util tests: date tests update | ||
* add util tests. remove util tests from recurrence tests | ||
* recurrence: remove util methods | ||
* util: renames names method | ||
* refact: creates new 'util' function | ||
* minnor changes | ||
* add lisb to Carilu | ||
* add time dependencies | ||
* copy working files | ||
* add ngen files | ||
n.n.n / 2011-10-21 | ||
0.0.2 / 2011-10-21 | ||
================== | ||
* cleaning | ||
* removing, ckeaning, etc tests | ||
* refac: add string tests | ||
* calen is officially killed | ||
* atom: doc | ||
* Atom: add genEvent() tests | ||
* RFC2445: remove atom tests | ||
* atom: genEvent() | ||
* atom: rename to genEvent() method | ||
* RFC2445 refact: add atom lib | ||
* RFC2445 refact: remove tests | ||
* RFC2445 refact: remove objEventToAtom() function from calen | ||
* RFC2445 refact: all genRecurrenceString() tests passed | ||
* RFC2445 refact: doc in genRecurrenceString | ||
* RFC2445 refact: rename getRecurrenceXML by genRecurrenceString | ||
* RFC2445 refact: all getRecurrencObt() tests passed | ||
* RFC2445 refact: rename getObject() to getRecurrenceObj() | ||
* RFC2445 refact: remove getFrequency() tests from calen | ||
* RFC2445 refact: remove getObject() function | ||
* RFC2445 refact: getAllDay() test | ||
* RFC2445 refact: getAllDay() | ||
* RFC2445 refact: remove tests form calen.test | ||
* RFC2445 refact: remove getAllday function | ||
* RFC2445 refact: getFrequency() tests passed | ||
* RFC2445 refat: add getFrequency() function | ||
* RFC2445 refat: remove functions from calen to rfc2445 | ||
* refact: add rfc2445.js new lib file. | ||
* change label test | ||
* remove parseDate = {} | ||
* refact:parse date test passed | ||
* remove time module | ||
* refact: fixed naming bug | ||
* rename Alias | ||
* refact: moving usefull parsing date functions from calen to util | ||
* refact: moving usefull string function from calen to util | ||
* testing - add _print() like module | ||
* main: add new tests file. | ||
* rename lib main file to index.js | ||
* npm: not private module | ||
* util: require just util modele | ||
* not export util module | ||
* .. | ||
* util: add daysMap to date constants | ||
* RFC2445 refact | ||
* recurrence: normalized lib | ||
* recurrence: nromalized all tests | ||
* util: exports date constants | ||
* util: rename getEventDuration() by getDuration() | ||
* cleaning util tests | ||
* util tests: date tests update | ||
* add util tests. remove util tests from recurrence tests | ||
* recurrence: remove util methods | ||
* util: renames names method | ||
* refact: creates new 'util' function | ||
* minnor changes | ||
* add lisb to Carilu | ||
* add time dependencies | ||
* copy working files | ||
* add ngen files | ||
@@ -382,0 +140,0 @@ 0.0.1 / 2010-01-03 |
@@ -16,3 +16,3 @@ /*! | ||
var util = serverSide ? require('./util') : window.Carilu.Util | ||
var util = serverSide ? require('./util') : window.caTools.Util | ||
@@ -43,3 +43,3 @@ /** | ||
// alias Instance prototype | ||
var _pttInst = Instance.prototype; | ||
var pptInst = Instance.prototype; | ||
@@ -50,3 +50,3 @@ /** | ||
_pttInst._create = function (dateReference) { | ||
pptInst._create = function (dateReference) { | ||
var clone = this.clone() | ||
@@ -81,3 +81,3 @@ , diff = _date.getDiff(this._seed.ev.end, this._seed.ev.start); | ||
_pttInst.clone = function () { | ||
pptInst.clone = function () { | ||
var newInstance = JSON.parse(JSON.stringify(this._seed.ev)); | ||
@@ -105,3 +105,3 @@ | ||
_pttInst.getNumber = function () { | ||
pptInst.getNumber = function () { | ||
return this.n; | ||
@@ -115,3 +115,3 @@ } | ||
_pttInst.isLast = function () { | ||
pptInst.isLast = function () { | ||
var c = this.getSeed()._getCountdown(); | ||
@@ -125,3 +125,3 @@ return this.getNumber() === (c - 1); | ||
_pttInst.getPrev = function () { | ||
pptInst.getPrev = function () { | ||
return this._prevInst; | ||
@@ -134,14 +134,14 @@ } | ||
_pttInst.getSeed = function () { | ||
pptInst.getSeed = function () { | ||
return this._seed; | ||
} | ||
// client-side: add Carilu global var | ||
// client-side: add caTools global var | ||
if (!serverSide) { | ||
if (typeof window.Carilu == 'undefined') | ||
window.Carilu = {}; | ||
if (typeof window.caTools == 'undefined') | ||
window.caTools = {}; | ||
window.Carilu.Instance = modInstance; | ||
window.caTools.Instance = modInstance; | ||
} | ||
})(typeof module != 'undefined' ? module : {}, typeof window != 'object'); |
@@ -16,3 +16,3 @@ /*! | ||
*/ | ||
var Seed = serverSide ? require('./seed') : window.Carilu.Seed; | ||
var Seed = serverSide ? require('./seed') : window.caTools.Seed; | ||
@@ -30,3 +30,3 @@ /** | ||
* | ||
* @param {Object} ev: object event | ||
* @param {Object|Array} evs: object event or an array events collection | ||
* @param {Object} options: { | ||
@@ -131,10 +131,10 @@ * period: { | ||
// client-side: add Carilu global var | ||
// client-side: add caTools global var | ||
if (!serverSide) { | ||
if (typeof window.Carilu == 'undefined') | ||
window.Carilu = {}; | ||
if (typeof window.caTools == 'undefined') | ||
window.caTools = {}; | ||
window.Carilu.Recurrence = modRecurrence; | ||
window.caTools.Recurrence = modRecurrence; | ||
} | ||
})(typeof module != 'undefined' ? module : {}, typeof window != 'object'); |
@@ -16,4 +16,4 @@ /*! | ||
var util = serverSide ? require('./util') : window.Carilu.Util | ||
, Instance = serverSide ? require('./instance') : window.Carilu.Instance; | ||
var util = serverSide ? require('./util') : window.caTools.Util | ||
, Instance = serverSide ? require('./instance') : window.caTools.Instance; | ||
@@ -67,3 +67,3 @@ /** | ||
// set event like a property | ||
// set event like a object property | ||
this.ev = ev; | ||
@@ -79,3 +79,3 @@ | ||
// alias Instance prototype | ||
var _pttSeed = Seed.prototype; | ||
var pptSeed = Seed.prototype; | ||
@@ -90,3 +90,3 @@ /** | ||
_pttSeed.setPeriod = function (start, end) { | ||
pptSeed.setPeriod = function (start, end) { | ||
start = start || this.options.start || this.parent.period.start || new Date(); | ||
@@ -114,3 +114,3 @@ end = end || this.options.end || this.parent.period.end; | ||
_pttSeed.normalize = function () { | ||
pptSeed.normalize = function () { | ||
// date tz correction. tz in minutes | ||
@@ -202,3 +202,3 @@ function tzCorrection(date, tz) { | ||
_pttSeed.getElapsedInstances = function (limitDate, addPartialInstance) { | ||
pptSeed.getElapsedInstances = function (limitDate, addPartialInstance) { | ||
// alias | ||
@@ -282,3 +282,3 @@ var ev = this.ev | ||
_pttSeed.genInstances = function (start, end) { | ||
pptSeed.genInstances = function (start, end) { | ||
// redefine period | ||
@@ -343,7 +343,7 @@ if (start || end) | ||
_pttSeed.getInstances = function (start, end) { | ||
pptSeed.getInstances = function (start, end) { | ||
return this.genInstances(start, end); | ||
} | ||
_pttSeed._walkWeek = function (start, mark, fn) { | ||
pptSeed._walkWeek = function (start, mark, fn) { | ||
var cursorDay = start.getDay() | ||
@@ -379,3 +379,3 @@ , addDays = 0 | ||
_pttSeed._getCountdown = function () { | ||
pptSeed._getCountdown = function () { | ||
// alias | ||
@@ -415,3 +415,3 @@ var start = this.period.start | ||
_pttSeed.setJumpingVector = function () { | ||
pptSeed.setJumpingVector = function () { | ||
var ev = this.ev; | ||
@@ -459,3 +459,3 @@ | ||
_pttSeed._getJumpingVector = function () { | ||
pptSeed._getJumpingVector = function () { | ||
return this.jumpingVector; | ||
@@ -468,3 +468,3 @@ } | ||
_pttSeed._getDateInstance = function (_limit, dir) { | ||
pptSeed._getDateInstance = function (_limit, dir) { | ||
var ev = this.ev; | ||
@@ -599,3 +599,3 @@ | ||
_pttSeed._getDatePrevInstance = function (ref) { | ||
pptSeed._getDatePrevInstance = function (ref) { | ||
return this._getDateInstance(ref); | ||
@@ -608,3 +608,3 @@ } | ||
_pttSeed._getDateNextInstance = function (ref) { | ||
pptSeed._getDateNextInstance = function (ref) { | ||
var next = this._getDateInstance(ref, 'next'); | ||
@@ -618,3 +618,3 @@ return next; | ||
_pttSeed._getDateNextJump = function (_ref) { | ||
pptSeed._getDateNextJump = function (_ref) { | ||
@@ -633,10 +633,10 @@ var ref = new Date(+_ref + (_date.getDiff(this.ev.end, this.ev.start))) | ||
// client-side: add Carilu global var | ||
// client-side: add caTools global var | ||
if (!serverSide) { | ||
if (typeof window.Carilu == 'undefined') | ||
window.Carilu = {}; | ||
if (typeof window.caTools == 'undefined') | ||
window.caTools = {}; | ||
window.Carilu.Seed = modSeed; | ||
window.caTools.Seed = modSeed; | ||
} | ||
})(typeof module != 'undefined' ? module : {}, typeof window != 'object'); |
@@ -471,10 +471,10 @@ /*! | ||
// client-side: add Carilu global var | ||
// client-side: add caTools global var | ||
if (!serverSide) { | ||
if (typeof window.Carilu == 'undefined') | ||
window.Carilu = {}; | ||
if (typeof window.caTools == 'undefined') | ||
window.caTools = {}; | ||
window.Carilu.Util = { date: _date, string: _string }; | ||
window.caTools.Util = { date: _date, string: _string }; | ||
} | ||
})(typeof module != 'undefined' ? module : {}, typeof window != 'object'); |
{ | ||
"name": "calendar-tools" | ||
, "version": "0.1.5" | ||
, "version": "0.1.6" | ||
, "description": "Calendar object model" | ||
, "keywords": ["calendar", "google calendar", "fullCalendar", "recurring events"] | ||
, "keywords": ["calendar", "google calendar", "fullCalendar", "recurring events", "icalendar", "rfc2445"] | ||
, "author": "Damian Suarez <damian@learnboost.com>" | ||
@@ -13,6 +13,9 @@ , "homepage": "http://learnboost.github.com/calendar-tools" | ||
, "dependencies": { | ||
"time": "0.6.4" | ||
"time": "0.6.x" | ||
} | ||
, "main": "index" | ||
, "devDependencies": { | ||
"expresso": "x.x.x" | ||
} | ||
, "main": "./lib/calendar-tools.js" | ||
, "engines": { "node": "0.4.x" } | ||
} |
@@ -6,3 +6,3 @@ | ||
var Carilu = require('../') | ||
var caTools = require('../lib/calendar-tools') | ||
, assert = require('assert'); | ||
@@ -82,3 +82,3 @@ | ||
// seed object | ||
var Seed = Carilu.seed(seedDailyEvent); | ||
var Seed = caTools.seed(seedDailyEvent); | ||
@@ -120,3 +120,3 @@ // prev date into current period | ||
seedDailyEvent.allDay = true; | ||
var Seed = Carilu.seed(seedDailyEvent); | ||
var Seed = caTools.seed(seedDailyEvent); | ||
@@ -153,3 +153,3 @@ // prev date into current period | ||
// seed object | ||
var Seed = Carilu.seed(seedWeeklyEvent); | ||
var Seed = caTools.seed(seedWeeklyEvent); | ||
@@ -204,3 +204,3 @@ var referenceDate = new Date(2011, 8, 25); | ||
// seed object | ||
var Seed = Carilu.seed(seedMonthlyEvent); | ||
var Seed = caTools.seed(seedMonthlyEvent); | ||
@@ -254,3 +254,3 @@ var referenceDate = new Date(2011, 8, 29, 10); | ||
// seed object | ||
var Seed = Carilu.seed(seedMonthlyEvent); | ||
var Seed = caTools.seed(seedMonthlyEvent); | ||
@@ -294,3 +294,3 @@ var referenceDate = new Date(2011, 8, 25); | ||
var Seed = Carilu.seed(seedYearlyEvent); | ||
var Seed = caTools.seed(seedYearlyEvent); | ||
@@ -323,3 +323,3 @@ var referenceDate = new Date(2013, 8, 26); | ||
// seed object | ||
var Seed = Carilu.seed(seedDailyEvent); | ||
var Seed = caTools.seed(seedDailyEvent); | ||
@@ -357,3 +357,3 @@ // prev date into current period | ||
seedDailyEvent.allDay = true; | ||
var Seed = Carilu.seed(seedDailyEvent); | ||
var Seed = caTools.seed(seedDailyEvent); | ||
@@ -397,3 +397,3 @@ // prev date into current period | ||
// seed object | ||
var Seed = Carilu.seed(seedWeeklyEvent); | ||
var Seed = caTools.seed(seedWeeklyEvent); | ||
@@ -442,3 +442,3 @@ var referenceDate = new Date(2011, 8, 25); | ||
seedMonthlyEvent.recurrence['repeat-on'] = { mode: 'day-of-month' }; | ||
var Seed = Carilu.seed(seedMonthlyEvent, { | ||
var Seed = caTools.seed(seedMonthlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -501,3 +501,3 @@ , end: new Date(2011, 10, 6) | ||
seedMonthlyEvent.recurrence['repeat-on'] = { mode: 'day-of-week' }; | ||
var Seed = Carilu.seed(seedMonthlyEvent, { | ||
var Seed = caTools.seed(seedMonthlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -580,3 +580,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedYearlyEvent); | ||
var Seed = caTools.seed(seedYearlyEvent); | ||
@@ -614,3 +614,3 @@ var referenceDate = new Date(2011, 8, 25); | ||
seedDailyEvent.allDay = false; | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: start | ||
@@ -667,3 +667,3 @@ , end: end | ||
seedDailyEvent.allDay = true; | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: start | ||
@@ -700,3 +700,3 @@ , end: end | ||
seedDailyEvent.allDay = true; | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: new Date(2011, 8, 26, 10) | ||
@@ -750,3 +750,3 @@ , end: new Date(2011, 8, 27, 11) | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: start | ||
@@ -816,3 +816,3 @@ , end: end | ||
// seed object | ||
var Seed = Carilu.seed(seedMonthlyEvent, { | ||
var Seed = caTools.seed(seedMonthlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -856,3 +856,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedMonthlyEvent, { | ||
var Seed = caTools.seed(seedMonthlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -917,3 +917,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
Seed = Carilu.seed(seedMonthlyEvent, { | ||
Seed = caTools.seed(seedMonthlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -936,3 +936,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedYearlyEvent, { | ||
var Seed = caTools.seed(seedYearlyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -979,3 +979,3 @@ , end: new Date(2011, 10, 6) | ||
var Seed = Carilu.seed(seedWeeklyEvent); | ||
var Seed = caTools.seed(seedWeeklyEvent); | ||
@@ -995,3 +995,3 @@ var vector = Seed._getJumpingVector() | ||
var Seed = Carilu.seed(normalEvent, { | ||
var Seed = caTools.seed(normalEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -1024,3 +1024,3 @@ , end: new Date(2011, 10, 6) | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: new Date(2011, 8, 25) | ||
@@ -1054,3 +1054,3 @@ , end: new Date(2011, 10, 6) | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: startDate | ||
@@ -1094,3 +1094,3 @@ , end: endDate | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: startDate | ||
@@ -1119,3 +1119,3 @@ , end: endDate | ||
var Seed = Carilu.seed(seedWeeklyEvent, { | ||
var Seed = caTools.seed(seedWeeklyEvent, { | ||
start: new Date (2011, 8, 25) | ||
@@ -1138,3 +1138,3 @@ , end: new Date (2011, 10, 6) | ||
seedWeeklyEvent.recurrence['repeat-on'] = { t: 'on', m: 'on' }; | ||
var Seed = Carilu.seed(seedWeeklyEvent, { | ||
var Seed = caTools.seed(seedWeeklyEvent, { | ||
start: new Date (2011, 8, 25) | ||
@@ -1161,3 +1161,3 @@ , end: new Date (2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: new Date(2011, 8, 25) | ||
@@ -1197,3 +1197,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: new Date(2011, 8, 25) | ||
@@ -1238,3 +1238,3 @@ , end: new Date(2011, 10, 6) | ||
// seed object | ||
var Seed = Carilu.seed(seedEv, { | ||
var Seed = caTools.seed(seedEv, { | ||
start: new Date(2011, 8, 25) | ||
@@ -1265,3 +1265,3 @@ , end: new Date(2011, 10, 6) | ||
seedDailyEvent.recurrence['end-by'].type = 'never'; | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: new Date(2011, 9, 4) | ||
@@ -1284,3 +1284,3 @@ , end: new Date(2011, 10, 6) | ||
seedDailyEvent.recurrence['end-by'].type = 'never'; | ||
var Seed = Carilu.seed(seedDailyEvent, { | ||
var Seed = caTools.seed(seedDailyEvent, { | ||
start: new Date(2011, 9, 4) | ||
@@ -1287,0 +1287,0 @@ , end: new Date(2011, 10, 6) |
@@ -6,48 +6,41 @@ | ||
var Util = require('../lib/util') | ||
var util = require('../lib/util') | ||
, assert = require('assert') | ||
, print = require('./print') | ||
, date = util.date | ||
, event = util.event | ||
/** | ||
* Alias | ||
* Utility function. | ||
* | ||
* @param {Date} start date | ||
* @param {Date} end date | ||
* @return {Object} seed event | ||
*/ | ||
var _date = Util.date | ||
, event = Util.event; | ||
var _print = require('./print'); | ||
/** | ||
* test usefull function | ||
* return a event seed | ||
* | ||
* @param {Date} start | ||
* @para, {Date} end | ||
*/ | ||
function getSeedEvent (start, end) { | ||
return seedEv = { | ||
title: 'getRecEvents' | ||
, start: start | ||
, end: end | ||
, allDay: false | ||
, frequency: 'day' | ||
, recurrence: { | ||
'end-by': { | ||
after: 4 | ||
, type: 'after' | ||
} | ||
, every: 4 | ||
} | ||
} | ||
function getSeedEvent (start, end) { | ||
return seedEv = { | ||
title: 'getRecEvents' | ||
, start: start | ||
, end: end | ||
, allDay: false | ||
, frequency: 'day' | ||
, recurrence: { | ||
'end-by': { | ||
after: 4 | ||
, type: 'after' | ||
} | ||
, every: 4 | ||
} | ||
} | ||
} | ||
module.exports = { | ||
module.exports = { | ||
'getFormattedDate() - complete with zero': function() { | ||
_print ('util - date', 'getFormattedDate() - complete with zero'); | ||
print('util - date', 'getFormattedDate() - complete with zero'); | ||
var start = new Date (1977, 6, 8, 16, 40, 35); | ||
var start = new Date(1977, 6, 8, 16, 40, 35) | ||
, date_string = date.getFormattedDate(start, true) | ||
// start date: Sat, 01 Oct 2011 13:30:00 GMT | ||
var date_string = _date.getFormattedDate(start, true); | ||
assert.equal(date_string, '07/08/1977'); | ||
@@ -57,6 +50,6 @@ }, | ||
'getFormattedDate() - no complete': function() { | ||
_print ('util - date', 'getFormattedDate() - no complete'); | ||
print('util - date', 'getFormattedDate() - no complete'); | ||
var start = new Date (1977, 6, 8, 16, 40, 35) | ||
, date_string = _date.getFormattedDate(start); | ||
var start = new Date(1977, 6, 8, 16, 40, 35) | ||
, date_string = date.getFormattedDate(start); | ||
@@ -67,5 +60,5 @@ assert.equal(date_string, '7/8/1977'); | ||
'getDiff()': function() { | ||
_print ('util - date', 'getDiff'); | ||
print('util - date', 'getDiff'); | ||
var start = new Date (2011, 10, 1, 16); | ||
var start = new Date(2011, 10, 1, 16); | ||
@@ -76,3 +69,3 @@ for (var i = 1; i < 1000; i++) { | ||
var diffInDays = _date.getDiff(limit, start) / _date.const.day; | ||
var diffInDays = date.getDiff(limit, start) / date.const.day; | ||
assert.equal(0, (diffInDays % 1)); | ||
@@ -83,90 +76,89 @@ }; | ||
'getDiffInDays() - round': function() { | ||
_print ('util - date', 'getDiffInDays() - round'); | ||
print('util - date', 'getDiffInDays() - round'); | ||
var start = new Date (2011, 10, 1, 16) | ||
, end = new Date (2011, 10, 9, 16); | ||
assert.equal(8, _date.getDiffInDays(end, start)); | ||
var start = new Date(2011, 10, 1, 16) | ||
, end = new Date(2011, 10, 9, 16) | ||
start = new Date (2011, 10, 1, 16); | ||
end = new Date (2011, 10, 9, 22); | ||
assert.equal(9, _date.getDiffInDays(end, start)); | ||
assert.equal(8, date.getDiffInDays(end, start)); | ||
start = new Date(2011, 10, 1, 16); | ||
end = new Date(2011, 10, 9, 22); | ||
assert.equal(9, date.getDiffInDays(end, start)); | ||
}, | ||
'getDiffInMonths() - round': function() { | ||
_print ('util - date', 'getDiffInMonths() - round'); | ||
print('util - date', 'getDiffInMonths() - round'); | ||
var start = new Date (2011, 8, 26, 16, 40, 35) | ||
, end = new Date (2011, 8, 28); | ||
assert.equal(0, _date.getDiffInMonths(end, start)); | ||
var start = new Date(2011, 8, 26, 16, 40, 35) | ||
, end = new Date(2011, 8, 28); | ||
assert.equal(0, date.getDiffInMonths(end, start)); | ||
end = new Date (2011, 11, 10); | ||
assert.equal(3, _date.getDiffInMonths(end, start)); | ||
end = new Date(2011, 11, 10); | ||
assert.equal(3, date.getDiffInMonths(end, start)); | ||
end = new Date (2012, 4, 30); | ||
assert.equal(8, _date.getDiffInMonths(end, start)); | ||
end = new Date(2012, 4, 30); | ||
assert.equal(8, date.getDiffInMonths(end, start)); | ||
}, | ||
'getDiffInMonths() - NOT round': function() { | ||
_print ('util - date', 'getDiffInMonths() - NOT round'); | ||
print('util - date', 'getDiffInMonths() - NOT round'); | ||
var start = new Date (2011, 8, 26, 16, 40, 35) | ||
, end = new Date (2011, 8, 28); | ||
assert.equal(0, _date.getDiffInMonths(end, start, true)); | ||
var start = new Date(2011, 8, 26, 16, 40, 35) | ||
, end = new Date(2011, 8, 28); | ||
assert.equal(0, date.getDiffInMonths(end, start, true)); | ||
end = new Date (2011, 11, 10); | ||
assert.equal(2, _date.getDiffInMonths(end, start, true)); | ||
end = new Date(2011, 11, 10); | ||
assert.equal(2, date.getDiffInMonths(end, start, true)); | ||
end = new Date (2012, 4, 30); | ||
assert.equal(8, _date.getDiffInMonths(end, start, true)); | ||
end = new Date(2012, 4, 30); | ||
assert.equal(8, date.getDiffInMonths(end, start, true)); | ||
end = new Date (2011, 9, 26, 16, 40, 35) | ||
assert.equal(1, _date.getDiffInMonths(end, start)); | ||
assert.equal(1, _date.getDiffInMonths(end, start, true)); | ||
end = new Date(2011, 9, 26, 16, 40, 35) | ||
assert.equal(1, date.getDiffInMonths(end, start)); | ||
assert.equal(1, date.getDiffInMonths(end, start, true)); | ||
end = new Date (2011, 9, 26, 16, 40, 34) | ||
assert.equal(1, _date.getDiffInMonths(end, start)); | ||
assert.equal(0, _date.getDiffInMonths(end, start, true)); | ||
end = new Date(2011, 9, 26, 16, 40, 34) | ||
assert.equal(1, date.getDiffInMonths(end, start)); | ||
assert.equal(0, date.getDiffInMonths(end, start, true)); | ||
}, | ||
'getFormattedTime()': function() { | ||
_print ('util - date', 'getFormattedTime()'); | ||
print('util - date', 'getFormattedTime()'); | ||
var time_string = _date.getFormattedTime(new Date (1977, 6, 8, 1, 40, 35)); | ||
var time_string = date.getFormattedTime(new Date(1977, 6, 8, 1, 40, 35)); | ||
assert.equal(time_string, '01:40 AM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 0, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 0, 40, 35)); | ||
assert.equal(time_string, '12:40 AM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 11, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 11, 40, 35)); | ||
assert.equal(time_string, '11:40 AM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 12, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 12, 40, 35)); | ||
assert.equal(time_string, '12:40 PM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 13, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 13, 40, 35)); | ||
assert.equal(time_string, '01:40 PM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 19, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 19, 40, 35)); | ||
assert.equal(time_string, '07:40 PM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 23, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 23, 40, 35)); | ||
assert.equal(time_string, '11:40 PM'); | ||
time_string = _date.getFormattedTime(new Date (1977, 6, 8, 24, 40, 35)); | ||
time_string = date.getFormattedTime(new Date(1977, 6, 8, 24, 40, 35)); | ||
assert.equal(time_string, '12:40 AM'); | ||
}, | ||
/* | ||
'parseISO8601()': function() { | ||
_print ('util - date', 'parseISO8601()'); | ||
print('util - date', 'parseISO8601()'); | ||
var str_date= '1977-07-18T20:40:35.012Z' | ||
var strdate= '1977-07-18T20:40:35.012Z' | ||
, date = new Date(1977, 6, 18, 20, 40, 35, 12); | ||
assert.equal(_date.parseISO8601(str_date).toUTCString(), date.toUTCString()); | ||
assert.equal(date.parseISO8601(strdate).toUTCString(), date.toUTCString()); | ||
}, | ||
'parseFromWeirdISOFormat() - \'yyyyddmm\' format': function (str) { | ||
_print('util - date', 'parseDate: fromWeirdISOFormat - \'yyyyddmm\' format'); | ||
print('util - date', 'parseDate: fromWeirdISOFormat - \'yyyyddmm\' format'); | ||
@@ -176,9 +168,9 @@ // test date: Mon, 18 Jul 1977 00:00:00 GMT | ||
, date = new Date(1977, 6, 18) | ||
, wiredDate = _date.parseFromWeirdISOFormat(strDate); | ||
, wiredDate = date.parseFromWeirdISOFormat(strDate); | ||
assert.equal(+date, +wiredDate); | ||
}, | ||
*/ | ||
'parseFromWeirdISOFormat() - \'yyyyddmmThhmmssZ\' format': function (str) { | ||
_print('util - date' | ||
print('util - date' | ||
, 'parseDate: fromWeirdISOFormat - \'yyyyddmmThhmmssZ\' format'); | ||
@@ -188,12 +180,12 @@ | ||
var strDate = '19770718T183554Z' | ||
, date = new Date(1977, 6, 18, 18, 35, 54) | ||
, wiredDate = _date.parseFromWeirdISOFormat(strDate); | ||
assert.equal(+date, +wiredDate); | ||
, newDate = new Date(1977, 6, 18, 18, 35, 54) | ||
, wiredDate = date.parseFromWeirdISOFormat(strDate); | ||
assert.equal(+newDate, +wiredDate); | ||
}, | ||
'clearTime() - not clone': function() { | ||
_print ('util - date', 'clearTime() - not clone'); | ||
print('util - date', 'clearTime() - not clone'); | ||
var oct2011 = new Date(2011, 9 , 1, 14, 32, 12, 987); | ||
_date.clearTime (oct2011); | ||
date.clearTime(oct2011); | ||
@@ -204,6 +196,6 @@ assert.equal(oct2011.toGMTString(), 'Sat, 01 Oct 2011 00:00:00 GMT'); | ||
'clearTime() - clone': function() { | ||
_print ('util - date', 'clearTime() - clone'); | ||
print('util - date', 'clearTime() - clone'); | ||
var oct2011 = new Date(2011, 9 , 1, 14, 32, 12, 987); | ||
var newCleartedDate = _date.clearTime (oct2011, true); | ||
var newCleartedDate = date.clearTime(oct2011, true); | ||
@@ -215,18 +207,20 @@ assert.equal(oct2011.toGMTString(), 'Sat, 01 Oct 2011 14:32:12 GMT'); | ||
'isLeapYear()': function(str) { | ||
_print ('util - date', 'isLeapYear()'); | ||
var leaps = [1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016]; | ||
var oct2011 = new Date(1976, 6 , 18, 23, 48, 54); | ||
print('util - date', 'isLeapYear()'); | ||
var leaps = [1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016] | ||
, oct2011 = new Date(1976, 6 , 18, 23, 48, 54); | ||
for (var year = 1976; year < 2016; year++) { | ||
assert.equal(leaps.indexOf(year) >= 0, _date.isLeapYear(year) | ||
, year + ' not is leap'); | ||
assert.equal( | ||
leaps.indexOf(year) >= 0 | ||
, date.isLeapYear(year) | ||
, year + ' not is leap' | ||
); | ||
}; | ||
}, | ||
'clearTime() - clone': function() { | ||
_print ('util - date', 'clearTime() - clone'); | ||
print('util - date', 'clearTime() - clone'); | ||
var oct2011 = new Date(2011, 9 , 1, 14, 32, 12, 987); | ||
var newCleartedDate = _date.clearTime (oct2011, true); | ||
var newCleartedDate = date.clearTime(oct2011, true); | ||
@@ -237,25 +231,22 @@ assert.equal(oct2011.toGMTString(), 'Sat, 01 Oct 2011 14:32:12 GMT'); | ||
'setByWeekAndDay()': function() { | ||
_print ('util - date', 'setByWeekAndDay()'); | ||
print('util - date', 'setByWeekAndDay()'); | ||
var date = new Date(2011, 9, 1); | ||
_date.setByWeekAndDay (date, 2, 4); | ||
assert.equal(date.toUTCString(), 'Thu, 20 Oct 2011 00:00:00 GMT'); | ||
var newDate = new Date(2011, 9, 1); | ||
date.setByWeekAndDay (newDate, 2, 4); | ||
assert.equal(newDate.toUTCString(), 'Thu, 20 Oct 2011 00:00:00 GMT'); | ||
_date.setByWeekAndDay (date, 0, 1); | ||
assert.equal(date.toUTCString(), 'Mon, 03 Oct 2011 00:00:00 GMT'); | ||
date.setByWeekAndDay (newDate, 0, 1); | ||
assert.equal(newDate.toUTCString(), 'Mon, 03 Oct 2011 00:00:00 GMT'); | ||
_date.setByWeekAndDay (date, 0, 5); | ||
assert.equal(date.toUTCString(), 'Fri, 07 Oct 2011 00:00:00 GMT'); | ||
date.setByWeekAndDay (newDate, 0, 5); | ||
assert.equal(newDate.toUTCString(), 'Fri, 07 Oct 2011 00:00:00 GMT'); | ||
var date = new Date(2011, 5, 1); | ||
_date.setByWeekAndDay (date, 0, 2); | ||
assert.equal(date.toUTCString(), 'Tue, 07 Jun 2011 00:00:00 GMT'); | ||
newDate = new Date(2011, 5, 1); | ||
date.setByWeekAndDay (newDate, 0, 2); | ||
assert.equal(newDate.toUTCString(), 'Tue, 07 Jun 2011 00:00:00 GMT'); | ||
}, | ||
'getWeekOfDay()': function() { | ||
_print ('util - date', 'getWeekOfDay()'); | ||
print('util - date', 'getWeekOfDay()'); | ||
@@ -270,19 +261,22 @@ var today = new Date | ||
var weekNumberVector = [ null, 0 | ||
, 0, 0, 0, 0, 0, 0, 1 | ||
, 1, 1, 1, 1, 1, 1, 2 | ||
, 2, 2, 2, 2, 2, 2, 3 | ||
, 3, 3, 3, 3, 3, 3, 4 | ||
, 4, 4, 4, 4, 4, 4, 5 | ||
]; | ||
var weekNumberVector = [ | ||
null, 0 | ||
, 0, 0, 0, 0, 0, 0, 1 | ||
, 1, 1, 1, 1, 1, 1, 2 | ||
, 2, 2, 2, 2, 2, 2, 3 | ||
, 3, 3, 3, 3, 3, 3, 4 | ||
, 4, 4, 4, 4, 4, 4, 5 | ||
]; | ||
// walk all days of Oct 2011 | ||
var w; | ||
for (var i = 1; i <= 31; i++) { | ||
oct2011.setDate(i); | ||
w = _date.getWeekOfDay(oct2011); | ||
assert.equal(weekNumberVector[i], w | ||
, oct2011.toUTCString() + ' | ' + weekNumberVector[i] + ' == ' + w); | ||
w = date.getWeekOfDay(oct2011); | ||
assert.equal( | ||
weekNumberVector[i] | ||
, w | ||
, oct2011.toUTCString() + ' | ' + weekNumberVector[i] + ' == ' + w | ||
); | ||
}; | ||
@@ -294,8 +288,9 @@ | ||
var weekNumberVector = [ null, 0, 0, 0, 0, 0 | ||
, 0, 0, 1, 1, 1, 1, 1 | ||
, 1, 1, 2, 2, 2, 2, 2 | ||
, 2, 2, 3, 3, 3, 3, 3 | ||
, 3, 3, 4, 4, 4, 4, 4 | ||
]; | ||
var weekNumberVector = [ | ||
null, 0, 0, 0, 0, 0 | ||
, 0, 0, 1, 1, 1, 1, 1 | ||
, 1, 1, 2, 2, 2, 2, 2 | ||
, 2, 2, 3, 3, 3, 3, 3 | ||
, 3, 3, 4, 4, 4, 4, 4 | ||
]; | ||
@@ -305,15 +300,18 @@ // walk all days of Oct 2011 | ||
may2012.setDate(i); | ||
w = _date.getWeekOfDay(may2012); | ||
assert.equal(weekNumberVector[i], w | ||
, may2012.toUTCString() + ' | ' + weekNumberVector[i] + ' == ' + w); | ||
w = date.getWeekOfDay(may2012); | ||
assert.equal( | ||
weekNumberVector[i] | ||
, w | ||
, may2012.toUTCString() + ' | ' + weekNumberVector[i] + ' == ' + w | ||
); | ||
}; | ||
}, | ||
}, | ||
/* | ||
'getDuration()': function() { | ||
_print ('util - event', 'getDuration()'); | ||
print('util - event', 'getDuration()'); | ||
// 12 - 13 - 14 | ||
var d1 = new Date (2011, 9, 12, 21, 43, 54) | ||
, d2 = new Date (2011, 9, 14, 21, 28, 17); | ||
var d1 = new Date(2011, 9, 12, 21, 43, 54) | ||
, d2 = new Date(2011, 9, 14, 21, 28, 17); | ||
@@ -335,3 +333,2 @@ var ev1 = { | ||
// duration for ev1, in days -> 1 (floor method) | ||
@@ -344,3 +341,2 @@ duration = event.getDuration(ev1, null, 'floor'); | ||
// duration for ev1, in hpures -> 48 | ||
@@ -353,3 +349,2 @@ duration = event.getDuration(ev1, 'hour'); | ||
// duration for ev1, in hours -> 47 (floor method) | ||
@@ -362,3 +357,2 @@ duration = event.getDuration(ev1, 'hour', 'floor'); | ||
ev1.start = new Date(2011, 8, 26, 10, 0, 0); | ||
@@ -371,3 +365,2 @@ ev1.end = new Date(2011, 8, 26, 12, 0, 0); | ||
ev1.end = new Date(2011, 8, 29, 23, 59, 59); | ||
@@ -379,3 +372,2 @@ // duration for ev1, in hours -> 47 (floor method) | ||
ev1.end = new Date(2011, 8, 29, 0, 0, 0); | ||
@@ -388,2 +380,3 @@ // duration for ev1, in hours -> 47 (floor method) | ||
*/ | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8741
453707
1
1
+ Addedtime@0.6.5(transitive)
- Removedtime@0.6.4(transitive)
Updatedtime@0.6.x