To display dates/times in French and Arabic correctly and ensure RTL layout for Arabic, you need to localize both text display and layout direction using Webflow's native tools and optional custom code.
toLocaleDateString()
method to format dates based on language.Example workaround:
span
with a data-date
attribute inside a collection list (e.g., <span class="localized-date" data-date="2024-06-05T00:00:00Z"></span>
).tag, insert custom JavaScript that:
.localized-date
elements.new Date().toLocaleDateString('fr-FR')
or 'ar-EG'
.lang
attribute:fr
ar
This improves accessibility, tells the browser which language to render, and helps assistive technologies.
Webflow does not auto-apply RTL, so you must define it manually using the following methods:
Method A: Add dir="rtl"
to the <html>
or <body>
tag — not possible in Webflow directly, so instead:
Method B: Add a custom attribute and CSS rule:
Go to Page Settings for your Arabic page.
Add a custom script (Before </body>
tag):
```javascript
document.body.setAttribute("dir", "rtl");
```
Or define a class on body
(e.g., rtl
), then in Site Settings > Custom Code or <style>
block:
Add CSS:
```
body[dir="rtl"] {
direction: rtl;
text-align: right;
}
```
Ensure text and components respect RTL flow by aligning items correctly in the Webflow Designer using right-aligned elements, flex, or grid with reversed direction.
To display dates properly and support RTL:
toLocaleDateString('fr-FR')
or ('ar-EG')
.lang
) in Page Settings.dir="rtl"
dynamically.