mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Merge pull request #3926 from Yashh56/feat/default-currency
feat: Add default currency support and update currency handling in Revenue component
This commit is contained in:
commit
2e62a06aa4
4 changed files with 19 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ export const LOCALE_CONFIG = 'umami.locale';
|
|||
export const TIMEZONE_CONFIG = 'umami.timezone';
|
||||
export const DATE_RANGE_CONFIG = 'umami.date-range';
|
||||
export const THEME_CONFIG = 'umami.theme';
|
||||
export const CURRENCY_CONFIG = 'umami.currency';
|
||||
export const DASHBOARD_CONFIG = 'umami.dashboard';
|
||||
export const LAST_TEAM_CONFIG = 'umami.last-team';
|
||||
export const VERSION_CHECK = 'umami.version-check';
|
||||
|
|
@ -25,6 +26,7 @@ export const DEFAULT_WEBSITE_LIMIT = 10;
|
|||
export const DEFAULT_RESET_DATE = '2000-01-01';
|
||||
export const DEFAULT_PAGE_SIZE = 20;
|
||||
export const DEFAULT_DATE_COMPARE = 'prev';
|
||||
export const DEFAULT_CURRENCY = 'USD';
|
||||
|
||||
export const REALTIME_RANGE = 30;
|
||||
export const REALTIME_INTERVAL = 10000;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { DEFAULT_CURRENCY } from './constants';
|
||||
|
||||
export function parseTime(val: number) {
|
||||
const days = ~~(val / 86400);
|
||||
const hours = ~~(val / 3600) - days * 24;
|
||||
|
|
@ -94,7 +96,7 @@ export function formatCurrency(value: number, currency: string, locale = 'en-US'
|
|||
// Fallback to default currency format if an error occurs
|
||||
formattedValue = new Intl.NumberFormat(locale, {
|
||||
style: 'currency',
|
||||
currency: 'USD',
|
||||
currency: DEFAULT_CURRENCY,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue