Skip to content

Commit

Permalink
Merge pull request #147 from xtremespb/core_290721
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
xtremespb committed Jul 30, 2021
2 parents 876aff8 + f629de1 commit e0e4983
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 53 deletions.
86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zoia3",
"version": "3.1.85",
"version": "3.1.86",
"description": "ZOIA Content Management System",
"scripts": {
"config": "node ./dev/bin/config.js",
Expand Down
3 changes: 3 additions & 0 deletions src/shared/marko/components/mform/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ module.exports = class {
if (field.type === "datepicker") {
valueProcess = value;
}
if (field.tags) {
valueProcess = value && typeof value === "string" ? value.split(",").map(v => v.trim()) : [];
}
return valueProcess;
}

Expand Down
22 changes: 13 additions & 9 deletions src/shared/marko/components/mform/mField/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,19 @@ module.exports = class {
}

updateDatePicker(value) {
this.calendarField.func.setDate(value);
this.setState("calendarValue", value);
const dateObject = typeof value === "string" ? parse(value, "yyyyMMdd", new Date()) : value;
this.setState("calendarValueText", format(dateObject, this.i18n.t("global.dateFormatShort")));
this.emit("value-change", {
type: "datepicker",
id: this.state.item.id,
value: dateObject,
});
if (value) {
this.calendarField.func.setDate(value);
this.setState("calendarValue", value);
const dateObject = typeof value === "string" ? parse(value, "yyyyMMdd", new Date()) : value;
this.setState("calendarValueText", format(dateObject, this.i18n.t("global.dateFormatShort")));
this.emit("value-change", {
type: "datepicker",
id: this.state.item.id,
value: dateObject,
});
} else {
this.setState("calendarValueText", "");
}
}

async onMount() {
Expand Down

0 comments on commit e0e4983

Please sign in to comment.