Mercurial > hg > extraction-interface
view geotemco/lib/simile/timeline/ext/planning/scripts/units.js @ 16:fb948097de39
fix bug: Edittaglist is working on Firefox.
fix bug: name of regex used to show with strange <span id="transmark"></span> showing only on FF but not Saf. Change it to use "document.getElementById(id).textContent to get the pure text string.
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 20 Feb 2015 16:39:08 +0100 |
parents | b12c99b7c3f0 |
children |
line wrap: on
line source
/*================================================== * Planning Unit *================================================== */ Timeline.PlanningUnit = new Object(); Timeline.PlanningUnit.DAY = 0; Timeline.PlanningUnit.WEEK = 1; Timeline.PlanningUnit.MONTH = 2; Timeline.PlanningUnit.QUARTER = 3; Timeline.PlanningUnit.YEAR = 4; Timeline.PlanningUnit.getParser = function(format) { return Timeline.PlanningUnit.parseFromObject; }; Timeline.PlanningUnit.createLabeller = function(locale, timeZone) { return new Timeline.PlanningLabeller(locale); }; Timeline.PlanningUnit.makeDefaultValue = function () { return 0; }; Timeline.PlanningUnit.cloneValue = function (v) { return v; }; Timeline.PlanningUnit.parseFromObject = function(o) { if (o == null) { return null; } else if (typeof o == "number") { return o; } else { try { return parseInt(o); } catch (e) { return null; } } }; Timeline.PlanningUnit.toNumber = function(v) { return v }; Timeline.PlanningUnit.fromNumber = function(n) { return n; }; Timeline.PlanningUnit.compare = function(v1, v2) { return v1 - v2; }; Timeline.PlanningUnit.earlier = function(v1, v2) { return Timeline.PlanningUnit.compare(v1, v2) < 0 ? v1 : v2; }; Timeline.PlanningUnit.later = function(v1, v2) { return Timeline.PlanningUnit.compare(v1, v2) > 0 ? v1 : v2; }; Timeline.PlanningUnit.change = function(v, n) { return v + n; };