SA5 | Sygnal Attributes | Designed for Webflow
Buy Us a Beer!Community ForumMicro-Consulting
  • ➡️Github Repo
  • 👫Sygnal Attributes Community
  • 📘Overview
    • Sygnal Attributes v5
    • How to Add Custom Code
    • What is Sygnal Attributes?
    • Sponsor a Feature ✨
    • What's New?
    • Library Modules
    • Technical Notes & Goals
      • CSS Media Queries
      • Callback Handlers
      • Custom Attributes
    • Documentation
    • Configuration Blocks
      • Configuration Block Specification
    • Preloaders
    • Breakpoints
    • Component Support 🧪
    • Sygnal Attributes ( SA5 ) Support
    • Dev Team Notes
    • GDPR
    • SA6
    • Triggers, Events & Actions
      • Triggers
        • Click Triggers
        • Scroll Into View Trigger
        • Hover Trigger
        • Timer Trigger
        • Form Triggers 🧪
          • Form Submit Trigger 🧪
        • Exit Intent Trigger 🧪
        • ECommerce Triggers 🧪
        • Inactivity Trigger 🧪
        • Page Load Trigger 🧪
        • Url Hash Trigger 🧪
        • Gated Trigger 🧪
        • Link Triggers 🧪
        • Reactiv Triggers 🧪
        • Interaction Trigger 🧪
      • Events
        • Namespacing
        • Event Data
        • Link-Based Triggers 🧪
        • Breakpoints 🧪
        • Persistent Events 🧪
        • Gated Events 🧪
      • Actions
        • Click Actions
        • Alert Action
        • Visibility Actions
        • Scroll Into View Action
        • Video Actions 🧪
        • Audio Action 🧪
        • Class Adder Actions 🧪
        • Tab Element Actions 🧪
        • Interaction Actions 🧪
        • Form Actions 🧪
        • Navigate Actions 🧪
        • Script Actions 🧪
    • SA5 Core
      • Handlers
      • Controllers
      • Core Processing
      • Core Technical Notes
        • Element Tracking
  • 📘sa5-cache
    • 🔍About SA5's Cache Lib
    • Data Caching ❺
      • Cache Setup v4
  • 📘sa5-socialshare
    • 🔍About SA5's Social Share Lib
    • 🚀Quick Start | SA5 Social Share
    • Email Social Share ❺
  • 📘sa5-detect 🧪
    • 🔍About SA5's Detect Lib
    • 🚀Quick Start | SA5 Detect
    • Page
    • User Agent Detection
    • Geolocation Detection 🧪
      • Cache Setup v4
    • Detect Incognito Mode
  • 📘sa5-analytics
    • 🔍About SA5's Analytics Lib
    • 🚀Quick Start | SA5 Analytics
    • A/B and Multivariate Testing
    • UTM Tracking
    • Rel Attributes
    • GA Events
    • GTM Events ❺🧪
      • Important dataLayer Notes
      • Facebook
      • Google Analytics ( GA4 )
      • Future
  • 📘sa5-data
    • 🔍About SA5's Data Lib
    • 🚀Quick Start | SA5 Data & Data-Binding
    • Usage Notes
    • Concepts & Terminology
      • Data Paths
      • Complex Data Sources
      • Developing Concepts 📝
    • Data Sources ( Simple )
      • URL Querystring Data Source
      • URL Part Data Source
      • User Info Data Source
      • Cookies & Web Storage Data Sources 📝
      • Global Data Source 🧪
    • Data Sources ( Complex )
      • RichText Data Source 🧪
      • Defining Custom Data Sources
      • Collection List Data Source 📝
        • Developing Concepts | Collection List Data Sources
    • Data Binding
      • Conditional Visibility
      • Form Elements 📝
      • Templates & Macro Expansion 📝
      • Developing Concepts on Data-Binding 📝
      • Macro Expansion
        • Macro Expansion
        • Count Items
      • Preloaders
    • SA5 Data ( HSON ) ❺🧪
      • SA5 Data BETA Kit
      • JSON Data Variants
    • Advanced Use
    • SA5 Data JS API
    • Future 📝
      • External Data
      • One-Way v. 2-way Bindings
      • Reactive Bindings
      • Data Sources ( External ) 🧪
        • Google Sheets Data Source ⛔
        • GitHub Data Data Source ⛔
  • 📘sa5-forms
    • 🔍About SA5's Forms Lib
      • SA5 Forms Roadmap
    • 🚀Quick Start | SA5 Forms
      • SA5 Forms Future
    • Data-binding Form INPUTs & SELECTs ❺
    • Smart Form Webhook Handler ❺
      • Form Webhook Handler JS API Events
      • n8n Handler
      • ▶️Basin Handler
        • File Uploads
        • Future
      • ▶️Make ( Integromat ) Handler
      • Future
    • Form Data Validation
      • Invalid Field Indicators (Real-Time) 🧪
      • Invalid Field Indicators on Submit Attempt 🧪
      • Email validation
    • Remove Unchecked Checkboxes ✨
    • Preserve Line Breaks
    • Form IP Info ❺
    • File Uploads 📝
    • Custom Form Submit Button
    • File Downloads
    • Form Select Element
    • SA5 Forms API
    • Dynamic Forms
    • Form Success Redirect 🧪
    • Show / Hide Password 🧪
  • 📘sa5-html
    • 🔍About SA5's HTML Lib
      • Webflow Interactions
    • 🚀Quick Start | SA5 HTML
    • Advanced Element Sorting ❺
    • Advanced Element Filtering ❺
      • Useful Filtering Examples
    • Dynamic URLs 🧪
      • Future
    • Dynamic Attributes
      • Future
        • Smart Attributes 🧪
        • Prefix, Postfix, and Formatted Attributes 🧪
    • Scroll to Section
    • Breakpoints ❺
    • Limit Items by Breakpoint ❺
      • Designer CSS Embed
    • Limit Items to Multiple-of ❺
    • Numeric Sequencing ❺
    • Truncate Text w/ Ellipsis ❺
    • Encoded Email
    • Hide Section w/ Empty Collection Lists ❺
    • Download File ❺
    • Decode HTML ❺
    • Markdown ❺
      • Themes
    • Transform ❺🧪
    • Code Formatting ❺🧪
    • CMS Code Injection ❺🧪
    • Responsive Tables ❺🧪
    • Text Formatting ❺🧪
    • Components ❺🧪
      • Component Object Positioning
    • Auto-Size IFRAMEs 🧪
    • Switch Case ❺🧪
    • Lazy Load
    • Gallery 🧪
    • Scroll Anchor
  • 📘sa5-layout
    • 🔍About SA5's Layout Lib
      • Future
    • 🚀Quick Start | SA5 Layout Lib
    • Layout ❺
      • Tabs Layout Handler
      • Slider Layout Handler 🧪
      • Future
    • Element Groups ❺🧪
    • Equal Height Rows ❺🧪
  • 📘sa5-logic 🧪
    • 🔍About SA5's Logic Lib
      • Future
    • 🚀Quick Start | SA5 Logic Lib
    • If ❺🧪
    • Switch ❺🧪
  • 📘sa5-booking
    • 🔍About SA5's Booking Lib
    • 🚀Quick Start | SA5 Booking Lib
    • GetTimely ❺🧪
    • SimplyBook ❺🧪
  • 📘sa5-richtext
    • 🔍About SA5's Rich Text Lib
      • Future
    • 🚀Quick Start | SA5 Rich Text
    • Nested Lists ❺
      • Legacy Feature Notes
    • GitHub Gists ❺
      • ▶️Video Tutorials
      • Why Gist?
      • Technical Notes
      • Future
    • Code Blocks 🧪
      • Wrapping Code Blocks
      • Copy Code to Clipboard
    • Excalidraw ( SVG Embeds )
    • URL Expanders 🧪
    • Annotations 🧪
    • Text SPAN Formatting 🧪
    • Lightboxes 🧪
      • Future
    • Embeddables
    • Richtext ❺🧪
      • CSS Isolation
    • Blockquotes
    • Call-Outs
    • Responsive Inline Images
  • 📘sa5-table
    • HTML Tables
  • 📘sa5-kiosk 🧪
    • 🔍About SA5's Kiosk Lib
    • 🚀Quick Start | SA5 Kiosk
    • Usage Notes
    • Kiosk Hardware & Browser Setup
    • Kiosk Base 🧪
    • Inactivity Timer
    • Display Mode
    • Technical Notes
    • Future
      • Smart Watch Notes
    • ToDo
  • 📘sa5-hotkeys
    • 🔍About SA5's Hotkeys Lib
    • 🚀Quick Start | SA5 Hotkeys
    • Hotkeys ❺
      • Future
  • 📘sa5-commerce
    • Payment Providers
    • Price in Local Currency 🧪
  • 📘sa5-demo
    • Webflow Preview Link
  • 📘sa5-ui
    • 🔍About SA5's UI Lib
    • 🚀Quick Start | SA5 UI
    • 5-Star Ratings Component ❺
  • 📘sa5-cro
    • 🔍About SA5's CRO Lib
    • 🚀Quick Start | SA5 CRO
    • Conversion Tracking Event
  • 📘sa5-url
    • 🔍About SA5's Url Lib
    • 🚀Quick Start | SA5 Url
    • Query Param Passthrough
      • Future
    • External Link Targeting
    • Relative Link Fixups ⛔
  • 📘sa5-video
    • 🔍About SA5's Webflow Video Lib
    • 🚀Quick Start | SA5 Video
    • Background Video Poster
    • Triggers, Events & Actions
    • YouTube Hide Related Videos [BETA]
      • Styling Options
      • Future
    • Media Pop-Ups 🧪
    • Video Player ( Direct )
    • Video Controller File Format
    • Media Controller
    • Video Player Controller
      • Video Playback Spec 🧪
      • YouTube Video Data 🧪
      • Loom Video Data 🧪
  • 📘sa5-elements
    • 🔍About SA5's Elements Lib
      • Elements Lib Future Plans
    • 🚀Quick Start | SA5 Elements
    • Element Actions 🧪
    • Tabs Element
      • Tabs Future Plans
      • Triggers, Events & Actions 🧪
      • Tabs API
    • Slider Element
      • Triggers, Events & Actions 🧪
      • Slider JS API
      • Slider JS API Events
      • Advanced Slider Use
      • Future
    • Deck Controller Element ⛔
    • Button Element
      • Triggers, Events & Actions 🧪
    • Dropdown Element
      • Triggers, Events & Actions 🧪
      • Future
    • Lightbox Element
      • CMS Lightbox + Groups
      • CMS Lightbox + Captions
        • Popular Lightbox Setups
      • Lightbox JS API
      • Triggers, Events & Actions 🧪
      • SA5 Lightbox Future
    • Radio Button Element 🧪
      • Triggers, Events & Actions 🧪
    • Autocomplete Element
      • Styling
      • Future
    • Accordion Element
      • Accordion Future Plans
      • Triggers, Events & Actions 🧪
      • Accordion API
    • Lottie Element ❺🧪
      • Triggers, Events & Actions 🧪
    • Locale Switcher Element ❺🧪
      • Technical Notes
      • JavaScript API
  • 📘sa5-format
    • 🔍About SA5's Format Lib
    • 🚀Quick Start | SA5 Format
    • Format Numbers & Currencies ❺
    • Format Dates ❺
      • Use Cases
        • Custom Format a Date
        • Localize a Date
        • From and To Relative Timespans
        • Age
      • Future - Date formatting
      • Setup Your Date Field for Good Parsing
  • 📘sa5-user-accounts
    • 🔍About SA5's Webflow User Accounts Lib
    • 🚀Quick Start | SA5 User Accounts
    • Logged-In User Info ❺
      • Custom User Fields
      • Webflow's UserID
      • Access Groups
        • Using Access Groups for Conditional Visibility
        • Using Access Groups for Routing ❺🧪
      • The User object
        • The User Object Lifecycle
      • Tips & Best Practices
      • User Info FAQs
      • Troubleshooting
      • ⏩Future Plans & Ideas
      • BETA testing
      • Technical Notes - Interfaces
      • Future Development
    • Advanced Log-In & Sign-Up Flow ❺
    • Conditional Element Display ❺
    • Expand Login Button ❺
  • 📘sa5-track
    • 🔍About SA5's Tracking Lib
    • 🚀Quick Start | SA5 Tracking
    • Webflow Cookies & Storage Tracking ❺
      • Conditional Element Visibility
      • Tracking Page Visits
      • Tracking Button Clicks
      • Track Query String Params
      • Track Checkbox State
      • Cloneable Demo
    • SA5 Referer Tracking ❺🧪
    • Future Plans
      • Likes & Favorites Tracking ❺🧪
      • Recently Viewed Tracking ❺🧪
  • 📘sa5-modals
    • 🔍About SA5's Webflow Modals & Popups Lib
    • 🚀Quick Start | SA5 Modals & Popups
    • Webflow Popups & Modals
      • Triggers
      • Gating Modals
      • Modal Design & Styling Notes
      • Simple Modals v. Custom Modals
      • Modal JS API
      • Page-Specific Modal Control
      • Common Configurations
      • Pro-Tips
      • SA5 Modals Roadmap & Future
        • Future Attributes
        • Future Triggers
    • Dismissible Elements
    • Triggers, Events & Actions 🧪
    • Webflow Modals & Popups Auto-Open and Auto-Close
    • Side Panels 🧪
  • 📘sa5-selectcustom
    • 🔍About SA5's Custom Form Select Lib
    • 🚀Quick Start | SA5 Custom Form Select
    • Triggers, Events & Actions 🧪
    • Custom Form Select ❺🧪
  • 📘sa5-gallery
    • 🔍About SA5's Gallery Lib
    • 🚀Quick Start | SA5 Gallery
    • Gallery ❺🧪
      • Simple Collage Layout Engine
  • 📘sa5-effects
    • 🔍About SA5's Effects Lib
    • 🚀Quick Start | SA5 Effects
    • Depthmap (Fake 3D) Image ❺🧪
    • Image Zoom
  • 📘sa5-fixup
    • Viewport META
    • Webflow Fixups ❺
  • 📘sa5-countup
    • CountUp Animated Numbers
  • 📘sa5-seo
    • 🔍About SA5's SEO Lib
    • 🚀Quick Start | SA5 SEO
    • Noindex ❺🧪
    • Nofollow ❺🧪
    • JSON-LD ❺🧪
      • JSON-LD Article ❺🧪
      • JSON-LD Video ❺🧪
      • JSON-LD Course Info ❺🧪
      • JSON-LD WebPage
      • JSON-LD Sitelinks Searchbox ❺🧪
  • 📘sa5-core
    • SA5 Core ❺
    • Webflow Designer Support ❺
  • 📘sa5-embeds
    • 🔍About SA5's Embeds Lib
    • 🚀Quick Start | SA5 Embeds
    • Table Embeds ❺
      • Google Doc Table Embeds
        • Styling Table Embeds
      • Google Sheets Table Embeds
      • Future
  • 📘sa5-state
    • 🔍About SA5's State Lib
    • 🚀Quick Start | SA5 State
    • State ❺🧪
      • State Handlers
        • SA5 State Handler
        • MobX
        • Redux
  • 📘sa5-localization
    • 🔍About SA5's Localization Lib
    • 🚀Quick Start | SA5 Localization
    • Localization Functions
    • Locale URLs
    • Sort locales in the order you choose
  • 📘sa5-404
    • 🔍About SA5's 404 Lib
    • 🚀Quick Start | SA5 404
    • 404 Smart Search ❺
  • 📘sa5-calc
    • 🔍About SA5's Calc Lib
      • Future
    • 🚀Quick Start | SA5 Calc
    • Count & Sum Items ❺
      • Source Types
      • Calc Use Cases
  • 📘sa5-trigger ⛔
    • 🔍About SA5's Trigger Lib
    • 🚀Quick Start | SA5 Trigger
    • IX Triggers ( Legacy ) ❺
  • 📘Deprecated Features
    • Repeater ⛔
    • Lipsum Generator ⛔
    • JSON Formatter ⛔
Powered by GitBook
On this page
  • Demonstration
  • Use Cases
  • Getting Started
  • STEP 1 - Add the Library
  • STEP 2 - Apply the custom attributes
  • Usage Notes
  • wfu-format-date = ( format string )
  • wfu-format-mode = ( mode )
  • wfu-format-handler = ( handler )
  • wfu-format-suffix = ( enable / disable )
  • wfu-format-locale = ( no value )
  • Feature Interoperability
  • Date Formatting Strings
  • Standard Date Formats
  • Time From Now Formats
  • Using Localized Date Formats
  • Best Practices
  • Make Your Dates Unambiguous with ISO8601

Was this helpful?

  1. sa5-format

Format Dates ❺

Give your dates the formatting you want

Last updated 2 months ago

Was this helpful?

Webflow supports the storage of dates and datetimes in the CMS, with a wide range of formatting options. However it's missing a few and more complex formats require hacks and javascript to achieve a desired result.

Webflow localization also doesn't currently support locale-specific date formatting.

SA5 Format allows you to format your dates and times in a huge range of recognized .

  • Use a format string to explicitly describe the formatting you want, supporting;

    • Full date-time strings of different arrangements

    • Full date strings of different arrangements

    • Partial, custom date or time constructions like "10 Mar"

  • Display relative-time phrasing as in "10 months ago" or "in 8 days" using the specified date relative to today. You can work with past dates, future dates, or use an "age" mode which shows the number of years elapsed since a date.

    • Good for "updated" dates on blogs and articles

    • Good for "years in service" dates on bio pages

  • Automatic localized formatting is supported, based on the <html lang> attribute which Webflow Localization uses. No matter what locale the user is switched to, your dates will display correctly for them.

Demonstration

Use Cases

SA5 Format has a lot of different settings, which can be used to achieve a lot of different results, and it can be confusing to wade through all of the options.

To help make setup easy, here are common setups for popular use cases.

Getting Started

For easiest setup, refer to your specific use case above.

STEP 1 - Add the Library

STEP 2 - Apply the custom attributes

SA5's formatting attributes are element-specific. You simply apply the custom attributes to the date elements you want specially formatted.

The details on the attributes are below.

Usage Notes

This module is built on top of day.js, which is the recognized standard for JS date-time formatting.

We strongly recommend that you use an ISO-8601 compatible format in the designer to ensure clear, consistent parsing of your dates.

wfu-format-date = ( format string )

Required. Place this directly on the element containing your date.

The format strings you can use depends on the configuration settings you have specified, especially wfu-format-mode, wfu-format-handler, and wfu-format-locale.

wfu-format-mode = ( mode )

Optional. Place directly on the element with the wfu-format-date attribute.

These are the modes;

  • date ( default ) - Indicates we're formatting the data as a full date.

  • from - Indicates the approximate relative timeperiod between the specified date and today, e.g. "10 months ago," or "in 8 days."

  • to - Indicates the approximate relative timeperiod between today and the specified date. This is the inverse of from.

  • age - Indicates the exact age, in years, between the specified date and today. Designed for past dates, such as birthdates.

FUTURE We're considering use cases for a rel relative formatting type which can handle both past and ruture dates and describe them appropriately.

wfu-format-handler = ( handler )

Optional. Place directly on the element with the wfu-format-date attribute.

Handler must be one of;

  • dayjs or day to use the DayJS library ( default )

  • momentjs or moment to use the MomentJS library

Momentjs support has been deprecated due to the obsolescence of the library.

wfu-format-suffix = ( enable / disable )

Optional. Place directly on the element with the wfu-format-date attribute.

  • on ( default ) will apply prefix and suffix text such as "in 3 months", or "3 months ago."

  • off will display the raw numeric value only, e.g. "3."

This setting works with modes of from, to, and age.

wfu-format-locale = ( no value )

Optional. Place directly on the element with the wfu-format-date attribute.

If specified, the date will be formatted according to the page's current language locale. This allows your Webflow localized site to have a blog, and to have the dates change depending on which locale the user selects.

Locale will be determined by the <html lang> attribute in the page, which is automatically set by Webflow Localization when it is correctly configured.

  • Use with the dayjs processor

This settings works with modes of date.

Feature Interoperability

SA5 Date Formatting exposes a lot of different options, some of which do not work together;

wfu-format-mode
wfu-format-locale
wfu-format-suffix

date

Compatible

Not applicable

from

Not yet supported

Compatible

to

Not yet supported

Compatible

age

Not yet supported

Compatible

Date Formatting Strings

The format string describes the date & time format you desire, and the syntax depends on the mode you choose and whether you have localized dates enabled via the locale attribute.

Here's a breakdown of the different types of format strings you can use;

wfu-format-mode
Non-Localized
Localized

date

Standard Date Formats

Localized Date Formats

from

Time From Now Formats

n/a

to

Time From Now Formats

n/a

age

( no format string needed )

n/a

Standard Date Formats

Use when wfu-format-mode = date. If wfu-format-locale is being used, these should work as well for custom localized date construction.

Format

Output

Description

YY

18

Two-digit year

YYYY

2018

Four-digit year

M

1-12

The month, beginning at 1

MM

01-12

The month, 2-digits

MMM

Jan-Dec

The abbreviated month name

MMMM

January-December

The full month name

D

1-31

The day of the month

DD

01-31

The day of the month, 2-digits

d

0-6

The day of the week, with Sunday as 0

dd

Su-Sa

The min name of the day of the week

ddd

Sun-Sat

The short name of the day of the week

dddd

Sunday-Saturday

The name of the day of the week

H

0-23

The hour

HH

00-23

The hour, 2-digits

h

1-12

The hour, 12-hour clock

hh

01-12

The hour, 12-hour clock, 2-digits

m

0-59

The minute

mm

00-59

The minute, 2-digits

s

0-59

The second

ss

00-59

The second, 2-digits

SSS

000-999

The millisecond, 3-digits

Z

+05:00

The offset from UTC, ±HH:mm

ZZ

+0500

The offset from UTC, ±HHmm

A

AM PM

a

am pm

Time From Now Formats

Use when wfu-format-mode = from or to.

Range
Key
Sample Output

0 to 44 seconds

s

a few seconds ago

45 to 89 seconds

m

a minute ago

90 seconds to 44 minutes

mm

2 minutes ago ... 44 minutes ago

45 to 89 minutes

h

an hour ago

90 minutes to 21 hours

hh

2 hours ago ... 21 hours ago

22 to 35 hours

d

a day ago

36 hours to 25 days

dd

2 days ago ... 25 days ago

26 to 45 days

M

a month ago

46 days to 10 months

MM

2 months ago ... 10 months ago

11 months to 17months

y

a year ago

18 months+

yy

2 years ago ... 20 years ago

Using Localized Date Formats

Use when wfu-format-mode = date and you have enabled the wfu-format-locale attribute.

Format
English Locale
Sample Output

LT

h:mm A

8:02 PM

LTS

h:mm:ss A

8:02:18 PM

L

MM/DD/YYYY

08/16/2018

LL

MMMM D, YYYY

August 16, 2018

LLL

MMMM D, YYYY h:mm A

August 16, 2018 8:02 PM

LLLL

dddd, MMMM D, YYYY h:mm A

Thursday, August 16, 2018 8:02 PM

l

M/D/YYYY

8/16/2018

ll

MMM D, YYYY

Aug 16, 2018

lll

MMM D, YYYY h:mm A

Aug 16, 2018 8:02 PM

llll

ddd, MMM D, YYYY h:mm A

Thu, Aug 16, 2018 8:02 PM

Best Practices

Make Your Dates Unambiguous with ISO8601

Date formats are inherently ambiguous, for example M-D-Y and D-M-Y can easily conflict and confuse scripts. To prevent this, we strongly advise that you choose the ISO8601 date format of YYYY-MM-DD.

In static date fields, you can simply enter your date in that format as in 2025-03-01 = March 1st 2025.

In CMS-bound date fields, you can choose this format by clicking the wrench next to the Date field in the right side settings panel.

"since" or "until" a date, from today

, years in service, years since a business was established

First, add the library as detailed in .

.

Use dayjs , listed here

See the full docs-

Learn more about Day.js .

📘
Custom-format a date
Show relative time
Show age
Localized dates
Quick Start
Learn more here
localized format strings
https://day.js.org/docs/en/display/format
https://day.js.org/docs/en/display/from-now
localized date formats
formats
Demo page
Demonstration and Cloneable
Format Dates
Formatting Numbers & Currencies - WebflowFormatting Numbers & Currencies
Logo
Logo