@@ -56,7 +56,7 @@ function formatBytes(bytes) {
5656const formatters = {
5757 toLocaleDate : ( el ) => ( value , _ ) => {
5858 const date = new Date ( value ) ;
59- return date . toLocaleDateString ( locale ( ) , {
59+ return date . toLocaleDateString ( navigator . language , {
6060 day : "numeric" ,
6161 month : "short" ,
6262 } ) ;
@@ -82,11 +82,6 @@ const tooltipFormatters = {
8282 formatHours : ( value ) => formatHours ( value , { includeMinutes : true } ) ,
8383} ;
8484
85- function locale ( ) {
86- const region = ( navigator . language || navigator . userLanguage ) . split ( "-" ) [ 1 ] ;
87- return `en-${ region } ` ;
88- }
89-
9085export default {
9186 mounted ( ) {
9287 this . render ( ) ;
@@ -343,23 +338,23 @@ function tooltipFormatter(options = {}) {
343338 if ( ! Number . isNaN ( Date . parse ( title ) ) ) {
344339 const date = new Date ( title ) ;
345340 if ( options . dateFormat == "minute" ) {
346- title = date . toLocaleDateString ( locale ( ) , {
341+ title = date . toLocaleDateString ( navigator . language , {
347342 day : "numeric" ,
348343 month : "short" ,
349344 year : "numeric" ,
350345 hour : "numeric" ,
351346 minute : "numeric" ,
352347 } ) ;
353348 } else if ( options . dateFormat == "hour" ) {
354- const dateStr = date . toLocaleDateString ( locale ( ) , {
349+ const dateStr = date . toLocaleDateString ( navigator . language , {
355350 day : "numeric" ,
356351 month : "short" ,
357352 year : "numeric" ,
358353 } ) ;
359354 const hour = String ( date . getHours ( ) ) . padStart ( 2 , "0" ) ;
360355 title = `${ dateStr } , ${ hour } :00` ;
361356 } else {
362- title = date . toLocaleDateString ( locale ( ) , {
357+ title = date . toLocaleDateString ( navigator . language , {
363358 day : "numeric" ,
364359 month : "short" ,
365360 year : "numeric" ,
0 commit comments