diff --git a/dataFields/ABFieldDateCore.js b/dataFields/ABFieldDateCore.js index e39719e..122025c 100644 --- a/dataFields/ABFieldDateCore.js +++ b/dataFields/ABFieldDateCore.js @@ -9,7 +9,10 @@ const ABField = require("../../platform/dataFields/ABField"); function L(key, altText) { // TODO: - return altText; // AD.lang.label.getLabel(key) || altText; + // return altText; // AD.lang.label.getLabel(key) || altText; + return key.replace(/{(\d+)}/g, function (match, number) { + return typeof altText[number] !== "undefined" ? altText[number] : match; + }); } const ABFieldDateDefaults = { @@ -311,7 +314,9 @@ module.exports = class ABFieldDateCore extends ABField { if (!isValid) validator.addError( this.columnName, - L("Should before {0}", [currentDate]) + L("Should before {0}", [ + this.getDateDisplay(currentDate), + ]) ); break; case "lessEqualCurrentDate": @@ -321,7 +326,9 @@ module.exports = class ABFieldDateCore extends ABField { if (!isValid) validator.addError( this.columnName, - L("Should before or equal {0}", [currentDate]) + L("Should before or equal {0}", [ + this.getDateDisplay(currentDate), + ]) ); break; }