67 lines
2.9 KiB
TypeScript
67 lines
2.9 KiB
TypeScript
// Module ID: 13930
|
|
// Function ID: 13931
|
|
// Name: getGiftRowDisplayInfo
|
|
// Dependencies: [1236, 3414, 5669, 2223, 2]
|
|
// Exports: formatGiftDate, getGiftRowDisplayInfo, getGiftSubtext
|
|
|
|
// Module 13930 (getGiftRowDisplayInfo)
|
|
const result = require("formatSingleCurrencyPrice").fileFinishedImporting("modules/parent_tools/FamilyCenterActivityGiftRowUtils.tsx");
|
|
|
|
export const getGiftRowDisplayInfo = function getGiftRowDisplayInfo(giftInfo) {
|
|
return { skuId: giftInfo.sku_id, subscriptionPlanId: giftInfo.subscription_plan_id, price: giftInfo.price, gifterUserId: giftInfo.gifter_user_id, claimed: giftInfo.claimed, offeredAt: giftInfo.offered_at, claimedAt: giftInfo.claimed_at };
|
|
};
|
|
export const formatGiftDate = function formatGiftDate(claimedAt) {
|
|
const dateTimeFormat = new Intl.DateTimeFormat(require(1236) /* getSystemLocale */.intl.currentLocale, { month: "short", day: "numeric" });
|
|
return dateTimeFormat.format(require(3414).parseISO(claimedAt));
|
|
};
|
|
export const getGiftSubtext = function getGiftSubtext(claimed) {
|
|
let claimedAt;
|
|
let gifterName;
|
|
let offeredAt;
|
|
let price;
|
|
({ price, gifterName, offeredAt, claimedAt } = claimed);
|
|
let formatPriceResult = null;
|
|
if (null != price) {
|
|
let obj = require(5669) /* formatSingleCurrencyPrice */;
|
|
formatPriceResult = obj.formatPrice(price.amount, price.currency);
|
|
}
|
|
if (null != formatPriceResult) {
|
|
if (null != gifterName) {
|
|
const intl = require(1236) /* getSystemLocale */.intl;
|
|
obj = { price: null, username: null };
|
|
obj[0] = formatPriceResult;
|
|
obj[1] = gifterName;
|
|
let formatToPlainStringResult = intl.formatToPlainString(importDefault(2223)["o44n/1"], obj);
|
|
}
|
|
const items = [formatToPlainStringResult, ];
|
|
const intl2 = require(1236) /* getSystemLocale */.intl;
|
|
const formatToPlainString = intl2.formatToPlainString;
|
|
const tmp11 = importDefault(2223);
|
|
if (claimed.claimed) {
|
|
if (claimedAt == null) {
|
|
claimedAt = offeredAt;
|
|
}
|
|
obj = { date: null };
|
|
const _Intl2 = Intl;
|
|
const dateTimeFormat = new Intl.DateTimeFormat(tmp8(1236).intl.currentLocale, { month: "short", day: "numeric" });
|
|
let tmp8Result = tmp8(3414);
|
|
obj[0] = dateTimeFormat.format(tmp8Result.parseISO(claimedAt));
|
|
let formatToPlainStringResult1 = formatToPlainString(tmp11.kDyllq, obj);
|
|
} else {
|
|
const obj1 = { date: null };
|
|
const _Intl = Intl;
|
|
const dateTimeFormat1 = new Intl.DateTimeFormat(tmp8(1236).intl.currentLocale, { month: "short", day: "numeric" });
|
|
tmp8Result = tmp8(3414);
|
|
obj1[0] = dateTimeFormat1.format(tmp8Result.parseISO(offeredAt));
|
|
formatToPlainStringResult1 = formatToPlainString(tmp11.gAG45y, obj1);
|
|
}
|
|
items[1] = formatToPlainStringResult1;
|
|
const _Boolean = Boolean;
|
|
const found = items.filter(Boolean);
|
|
return found.join(" \u2022 ");
|
|
}
|
|
formatToPlainStringResult = null;
|
|
if (null != formatPriceResult) {
|
|
formatToPlainStringResult = formatPriceResult;
|
|
}
|
|
};
|