first commit
This commit is contained in:
14
node_modules/vant/es/coupon/utils.mjs
generated
vendored
Normal file
14
node_modules/vant/es/coupon/utils.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { padZero } from "../utils/index.mjs";
|
||||
function getDate(timeStamp) {
|
||||
const date = new Date(timeStamp * 1e3);
|
||||
return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
|
||||
date.getDate()
|
||||
)}`;
|
||||
}
|
||||
const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
|
||||
const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
|
||||
export {
|
||||
formatAmount,
|
||||
formatDiscount,
|
||||
getDate
|
||||
};
|
||||
Reference in New Issue
Block a user