summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/calendar.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 12:17:17 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 12:17:17 +0200
commite25430117a67f5c898e5e9388ebd44b185d469ab (patch)
tree2b625f7778dfab0b5219bf6a868ab393eb5be9cd /toolkit/content/widgets/calendar.js
parenta1a007a4856fa50d6d811c2268f881e3666f4c67 (diff)
downloadUXP-e25430117a67f5c898e5e9388ebd44b185d469ab.tar
UXP-e25430117a67f5c898e5e9388ebd44b185d469ab.tar.gz
UXP-e25430117a67f5c898e5e9388ebd44b185d469ab.tar.lz
UXP-e25430117a67f5c898e5e9388ebd44b185d469ab.tar.xz
UXP-e25430117a67f5c898e5e9388ebd44b185d469ab.zip
moebius#92: HTML - input - datetime
+ native in moebius: Bug 1317600: https://bugzilla.mozilla.org/show_bug.cgi?id=1317600 A note - not implemented: Bug 1282768: https://bugzilla.mozilla.org/show_bug.cgi?id=1282768 *.css: filter: url("chrome://global/skin/filters.svg#fill");, fill: Bug 1283385: https://bugzilla.mozilla.org/show_bug.cgi?id=1283385 Bug 1323109: https://bugzilla.mozilla.org/show_bug.cgi?id=1323109 Bug 1314544: https://bugzilla.mozilla.org/show_bug.cgi?id=1314544 Bug 1286182: https://bugzilla.mozilla.org/show_bug.cgi?id=1286182 Bug 1325922: https://bugzilla.mozilla.org/show_bug.cgi?id=1325922 A note - not implemented: Bug 1282768: https://bugzilla.mozilla.org/show_bug.cgi?id=1282768 *.css: filter: url("chrome://global/skin/filters.svg#fill");, fill: Bug 1320225: https://bugzilla.mozilla.org/show_bug.cgi?id=1320225 Bug 1341190: https://bugzilla.mozilla.org/show_bug.cgi?id=1341190
Diffstat (limited to 'toolkit/content/widgets/calendar.js')
-rw-r--r--toolkit/content/widgets/calendar.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/toolkit/content/widgets/calendar.js b/toolkit/content/widgets/calendar.js
index 72e0d9d61..80c2976e0 100644
--- a/toolkit/content/widgets/calendar.js
+++ b/toolkit/content/widgets/calendar.js
@@ -54,23 +54,21 @@ function Calendar(options, context) {
* {
* {Number} textContent
* {Array<String>} classNames
+ * {Boolean} enabled
* }
* {Function} getDayString: Transform day number to string
* {Function} getWeekHeaderString: Transform day of week number to string
- * {Function} setValue: Set value for dateKeeper
- * {Number} selectionValue: The selection date value
+ * {Function} setSelection: Set selection for dateKeeper
* }
*/
setProps(props) {
if (props.isVisible) {
// Transform the days and weekHeaders array for rendering
- const days = props.days.map(({ dateValue, textContent, classNames }) => {
+ const days = props.days.map(({ dateObj, classNames, enabled }) => {
return {
- dateValue,
- textContent: props.getDayString(textContent),
- className: dateValue == props.selectionValue ?
- classNames.concat("selection").join(" ") :
- classNames.join(" ")
+ textContent: props.getDayString(dateObj.getUTCDate()),
+ className: classNames.join(" "),
+ enabled
};
});
const weekHeaders = props.weekHeaders.map(({ textContent, classNames }) => {
@@ -152,10 +150,10 @@ function Calendar(options, context) {
case "click": {
if (event.target.parentNode == this.context.daysView) {
let targetId = event.target.dataset.id;
- this.props.setValue({
- selectionValue: this.props.days[targetId].dateValue,
- dateValue: this.props.days[targetId].dateValue
- });
+ let targetObj = this.props.days[targetId];
+ if (targetObj.enabled) {
+ this.props.setSelection(targetObj.dateObj);
+ }
}
break;
}