Hello ReTool community !
I have this following query transformer that parse the date and format it to french.
It works like a charm on browser but when I go on mobile the date turn to US locale (see example after).
const dateFormat = new Intl.DateTimeFormat("fr-FR", {
timeZone: "Europe/Paris",
weekday: "long",
day: "numeric",
month: "long",
});
const timeFormat = new Intl.DateTimeFormat("fr-FR", {
timeZone: "Europe/Paris",
hour: "2-digit",
minute: "2-digit",
});
data.date = data.start_date.map((start_date) => {
const startDate = new Date(start_date);
return dateFormat.format(startDate);;
})
data.time_range = data.start_date.map((start_date, index) => {
const startDate = new Date(start_date);
const endDate = new Date(data.end_date[index]);
const time = timeFormat.format(startDate) + " - " + timeFormat.format(endDate)
return time;
})
return data;
Result on browser :
Result on mobile :
|
I wonder if someone had the same issue and how could I improve my code to make it works on mobile too ?
Thank you for your help
Have fun
Emilien