rerobe-js-orm 4.1.2 → 4.1.3

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.
@@ -672,7 +672,7 @@ class OrderHelpers {
672
672
  return Object.assign(Object.assign({ merchantLogoUrl, merchantName: name, legalName, storeAddress: buildStoreAddress(), phone,
673
673
  contactEmail,
674
674
  organizationNumber,
675
- primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber, additionalInfo: info, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
675
+ primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale, order === null || order === void 0 ? void 0 : order.createdAtTimestamp), receiptNumber, additionalInfo: info, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
676
676
  currencyCode,
677
677
  amount: (_e = (_d = order.subtotalPricePresentment) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : '',
678
678
  fractionDigits: 2,
@@ -37,4 +37,4 @@ export declare function formatPrice({ currencyCode, amount, fractionDigits, }: {
37
37
  amount: string | number;
38
38
  fractionDigits?: number;
39
39
  }): string;
40
- export declare function getFormattedTimestamp(locale: string): string;
40
+ export declare function getFormattedTimestamp(locale: string, timestamp?: number): string;
@@ -256,8 +256,8 @@ function formatPrice({ currencyCode, amount, fractionDigits = 2, }) {
256
256
  return priceFormatter.format(valueToFormat);
257
257
  }
258
258
  exports.formatPrice = formatPrice;
259
- function getFormattedTimestamp(locale) {
260
- const date = new Date();
259
+ function getFormattedTimestamp(locale, timestamp) {
260
+ const date = timestamp ? new Date(timestamp) : new Date();
261
261
  const hours = String(date.getHours()).padStart(2, '0');
262
262
  const minutes = String(date.getMinutes()).padStart(2, '0');
263
263
  return `${date.toLocaleDateString(locale)} ${hours}:${minutes}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",