You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a libary called jstz to detect the browser's timezone and use moment.js and momenttimezone.js to format. https://github.com/entraigas/jstz
consttimezone=jstz.determine().name();formatDate=(date,format)=>{constnormalTimezone=moment.tz(date,'Europe/Berlin');constconvertedDate=normalTimezone.clone().tz(timezone);if(format)returnconvertedDate.format(format);// Maybe add support for us dateselseif(region==='us')returnconvertedDate.format('MM.DD.YYYY | HH:mm');returnconvertedDate.format('DD.MM.YYYY | HH:mm');};
Activity