@enure/jacklin 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5540,9 +5540,12 @@ import_handlebars.default.registerHelper("or", (a, b) => a || b);
|
|
|
5540
5540
|
import_handlebars.default.registerHelper("getShortDate", (dateStr) => {
|
|
5541
5541
|
if (typeof dateStr === "string") {
|
|
5542
5542
|
const date = new Date(dateStr);
|
|
5543
|
+
if (isNaN(date.getTime())) {
|
|
5544
|
+
throw new Error(`Invalid date: "${dateStr}"`);
|
|
5545
|
+
}
|
|
5543
5546
|
const year = date.getFullYear();
|
|
5544
5547
|
const month = date.getMonth() + 1;
|
|
5545
|
-
const fullMonth = month.
|
|
5548
|
+
const fullMonth = String(month).padStart(2, "0");
|
|
5546
5549
|
return `${fullMonth}/${year}`;
|
|
5547
5550
|
} else {
|
|
5548
5551
|
return dateStr;
|