@open-tender/utils 0.5.14 → 0.5.16
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.
|
@@ -224,10 +224,10 @@ const makeReadableDateStrFromIso = (iso, tz, verbose = false, withTime = true) =
|
|
|
224
224
|
return verbose ? `Today @ ${timeString}` : timeString;
|
|
225
225
|
}
|
|
226
226
|
else if (dateString === (0, exports.tomorrowDate)()) {
|
|
227
|
-
return `${verbose ? 'Tomorrow' : 'Tmrw'} ${withTime
|
|
227
|
+
return `${verbose ? 'Tomorrow' : 'Tmrw'} ${withTime ? `@ ${timeString}` : ''}`;
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
|
-
return `${verbose ? (0, date_fns_tz_1.format)(date, 'EEE, MMM d') : (0, date_fns_tz_1.format)(date, 'M/d')} ${withTime
|
|
230
|
+
return `${verbose ? (0, date_fns_tz_1.format)(date, 'EEE, MMM d') : (0, date_fns_tz_1.format)(date, 'M/d')} ${withTime ? `@ ${timeString}` : ''}`;
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
exports.makeReadableDateStrFromIso = makeReadableDateStrFromIso;
|
package/dist/cjs/utils/menu.d.ts
CHANGED
|
@@ -127,4 +127,4 @@ export declare const makeMenuItemLayout: (position: ThemeImagePosition) => {
|
|
|
127
127
|
flexDirection: string;
|
|
128
128
|
alignItems: string;
|
|
129
129
|
};
|
|
130
|
-
export declare const makeSuspendUnitlMsg: (suspendedUntil: number, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
|
130
|
+
export declare const makeSuspendUnitlMsg: (suspendedUntil: number | null | undefined, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
package/dist/cjs/utils/menu.js
CHANGED
|
@@ -88,7 +88,7 @@ const makeSuspendUnitlMsg = (suspendedUntil, tz, soldOutMessage, withTime = true
|
|
|
88
88
|
const soldOutDynamicMsg = soldOutMessage === null || soldOutMessage === void 0 ? void 0 : soldOutMessage.replace('{{suspended_until}}', suspendedUntilDate
|
|
89
89
|
? (0, datetimes_1.makeReadableDateStrFromIso)(suspendedUntilDate.toISOString(), tz, false, withTime)
|
|
90
90
|
: '');
|
|
91
|
-
const soldOutMsg = soldOutDynamicMsg || 'Sold out for day';
|
|
91
|
+
const soldOutMsg = soldOutDynamicMsg || 'Sold out for the day';
|
|
92
92
|
return soldOutMsg;
|
|
93
93
|
};
|
|
94
94
|
exports.makeSuspendUnitlMsg = makeSuspendUnitlMsg;
|
|
@@ -185,10 +185,10 @@ export const makeReadableDateStrFromIso = (iso, tz, verbose = false, withTime =
|
|
|
185
185
|
return verbose ? `Today @ ${timeString}` : timeString;
|
|
186
186
|
}
|
|
187
187
|
else if (dateString === tomorrowDate()) {
|
|
188
|
-
return `${verbose ? 'Tomorrow' : 'Tmrw'} ${withTime
|
|
188
|
+
return `${verbose ? 'Tomorrow' : 'Tmrw'} ${withTime ? `@ ${timeString}` : ''}`;
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
|
-
return `${verbose ? format(date, 'EEE, MMM d') : format(date, 'M/d')} ${withTime
|
|
191
|
+
return `${verbose ? format(date, 'EEE, MMM d') : format(date, 'M/d')} ${withTime ? `@ ${timeString}` : ''}`;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
export const makeRequestedIso = (requestedAt) => {
|
package/dist/esm/utils/menu.d.ts
CHANGED
|
@@ -127,4 +127,4 @@ export declare const makeMenuItemLayout: (position: ThemeImagePosition) => {
|
|
|
127
127
|
flexDirection: string;
|
|
128
128
|
alignItems: string;
|
|
129
129
|
};
|
|
130
|
-
export declare const makeSuspendUnitlMsg: (suspendedUntil: number, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
|
130
|
+
export declare const makeSuspendUnitlMsg: (suspendedUntil: number | null | undefined, tz: Timezone, soldOutMessage: string | undefined, withTime?: boolean) => string;
|
package/dist/esm/utils/menu.js
CHANGED
|
@@ -80,6 +80,6 @@ export const makeSuspendUnitlMsg = (suspendedUntil, tz, soldOutMessage, withTime
|
|
|
80
80
|
const soldOutDynamicMsg = soldOutMessage === null || soldOutMessage === void 0 ? void 0 : soldOutMessage.replace('{{suspended_until}}', suspendedUntilDate
|
|
81
81
|
? makeReadableDateStrFromIso(suspendedUntilDate.toISOString(), tz, false, withTime)
|
|
82
82
|
: '');
|
|
83
|
-
const soldOutMsg = soldOutDynamicMsg || 'Sold out for day';
|
|
83
|
+
const soldOutMsg = soldOutDynamicMsg || 'Sold out for the day';
|
|
84
84
|
return soldOutMsg;
|
|
85
85
|
};
|
package/package.json
CHANGED