feat: build UI
This commit is contained in:
@@ -5,11 +5,12 @@ import dayjs from 'dayjs';
|
||||
import weekday from 'dayjs/plugin/weekday';
|
||||
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import localizedFormat from 'dayjs/plugin/localizedFormat'
|
||||
import 'dayjs/locale/vi';
|
||||
dayjs.extend(weekday);
|
||||
dayjs.extend(weekOfYear);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
dayjs.extend(localizedFormat);
|
||||
dayjs.locale('vi');
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
@@ -608,6 +609,12 @@ export default defineNuxtPlugin(() => {
|
||||
return `https://img.vietqr.io/image/${bankInfo.bank.code}-${bankInfo.account.number}-print.png?${params.toString()}`;
|
||||
};
|
||||
|
||||
function shortenCurrency(amount) {
|
||||
return new Intl.NumberFormat('en', { notation: 'compact' }).format(
|
||||
Number(amount),
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
provide: {
|
||||
dialog,
|
||||
@@ -636,6 +643,7 @@ export default defineNuxtPlugin(() => {
|
||||
formatDateVN,
|
||||
getFirstAndLastName,
|
||||
paymentQR,
|
||||
shortenCurrency
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user