commit client portal
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user