mirror of
https://github.com/mempool/mempool.git
synced 2026-08-15 12:50:34 +02:00
Merge pull request #1009 from mempool/wiz/tweak-xaxis-label-timestamp-format
Tweak the graph x-axis label date formatting for better i18n
This commit is contained in:
commit
adb5bfe93f
1 changed files with 2 additions and 3 deletions
|
|
@ -15,12 +15,11 @@ export const formatterXAxis = (
|
|||
case '24h':
|
||||
return date.toLocaleTimeString(locale, { weekday: 'short', hour: 'numeric', minute: 'numeric' });
|
||||
case '1w':
|
||||
return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
||||
case '1m':
|
||||
case '3m':
|
||||
case '6m':
|
||||
case '1y':
|
||||
return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' });
|
||||
return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
||||
case '2y':
|
||||
case '3y':
|
||||
return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' });
|
||||
|
|
@ -47,4 +46,4 @@ export const formatterXAxisLabel = (
|
|||
case '3y':
|
||||
return null;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue