commit client portal

This commit is contained in:
Muhammad Fajar
2023-09-27 15:39:20 +07:00
parent 3f54e07fb5
commit 2f7a450d28
11 changed files with 1830 additions and 1650 deletions

View File

@@ -4,21 +4,21 @@ import numeral from 'numeral';
// load a locale
numeral.register('locale', 'id', {
delimiters: {
thousands: '.',
decimal: ','
thousands: '.',
decimal: ',',
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't',
},
ordinal : function (number: number) {
return number === 1 ? 'er' : 'ème';
ordinal: function (number: number) {
return number === 1 ? 'er' : 'ème';
},
currency: {
symbol: 'Rp '
}
symbol: 'Rp ',
},
});
// switch between locales

View File

@@ -1,4 +1,4 @@
import { format,parseISO, getTime, setHours, setMinutes , formatDistanceToNow } from 'date-fns';
import { format, parseISO, getTime, setHours, setMinutes, formatDistanceToNow } from 'date-fns';
// ----------------------------------------------------------------------
@@ -21,10 +21,14 @@ export function fDateTimeSuffix(date: Date | string | number) {
export function fToNow(date: Date | string | number) {
return formatDistanceToNow(new Date(date), {
addSuffix: true
addSuffix: true,
});
}
export function fPostFormat(date: Date | string | number, dateFormat = 'yyyy-MM-dd HH:mm:ss') {
return format(new Date(date), dateFormat);
}
// export function fDateString(date) {
// const dateObj = parseISO(date);
// const formattedDate = format(dateObj, 'dd MMMM yyyy');
@@ -36,4 +40,4 @@ export function fToNow(date: Date | string | number) {
// const datePart = date.split(' ')[0]; // Memisahkan bagian tanggal
// const formattedDate = fDateString(datePart); // Menggunakan fungsi sebelumnya untuk memformat tanggal
// return formattedDate;
// }
// }