US English (US)
ES Spanish

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Log in
English (US)
US English (US)
ES Spanish
  • Home
  • Help & Support
  • Support
  • Deep Dive
  • Technical Guides
  • RIO Ed Components

Formatting Date Strings

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • RIO Certification
    RIO Certification Program RIO Academy RIO Challenge RIO Recipe Training
  • Releases
    V3 Release Notes V4 Release Notes
  • Help & Support
    Install RIO Education RIO Insights RIO Recipe Support RIO Graduate/Intern Program Trainee (GPT)
  • Experience RIO in action
+ More

RIO Education uses the Moment.js Javascript library for handling and displaying dates in our Lightning and Aura components.

While dates in Salesforce itself cannot be formatted, Moment.js allows us to provide a format string in order to customise how a particular time and date is displayed in our components.

For instance, a time of 2025-10-23T09:30:00Z can be configured to display as “Oct 23 2025”, “Thursday 23rd October”, “23/10/25”, “9:30 AM”, or even “Week 43”.

When a particular component supports providing a custom format string, you will see it exposed in that component's settings - for instance, these three fields in the RIO Ed - Session Scheduler.

 

For these, GGWW means “print the last two digits of the current ISO year followed by a two-digit ISO week number”; ddd D means “print the first three letters of the current day followed by the day of the month”; and ha means “print the current hour number followed by am or pm”.

Any text surrounded by [] will be ignored by the parser and have the square brackets removed, in case you wanted to include plain text in your formatted date.

Here is a table of some of the common options you may want to use:

Unit Option Result
12 Hour Time h 1, 2, 3, … 10, 11, 12
hh 01, 02, 03, … 10, 11, 12
24 Hour Time (start from zero) H 0, 1, 2, … 21, 22, 23
HH 00, 01, 02, … 21, 22, 23
24 Hour Time (start from one) k 1, 2, 3, … 22, 23, 24
kk 01, 02, 03, … 22, 23, 24
Minutes m 0, 1, 2, … 57, 58, 59
mm 00, 01, 02, … 57, 58, 59
AM / PM A AM, PM
a am, pm
Day D 1, 2, 3, … 29, 30, 31
DD 01, 02, 03, … 29, 30, 31
Do 1st, 2nd, 3rd, … 29th, 30th, 31st
ddd Mon, Tue, Wed, … Sat, Sun
dddd Monday, … Sunday
Month M 1, 2, 3, … 10, 11, 12
MM 01, 02, 03, … 10, 11, 12
MMM Jan, Feb, Mar, … Oct, Nov, Dec
MMMM January, … December
Year YY 08, 09, 10, … 23, 24, 25
YYYY 2008, 2009, … 2024, 2025

 

For further details please refer to the Moment.js documentation: https://momentjs.com/docs/#/displaying/format/

 

 

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • RIO Ed - Display Student Connections (Aura)
  • RIO Ed - Appointment Scheduler (Aura)
  • RIO Ed - Attendance Register (Aura)
  • RIO Ed - File Uploader (Aura)
  • RIO Ed - Related List - Single (Aura)
RIO Education

RIO Education, a WDCi Company. This information is proprietary, confidential and protected by copyright ©2024.

CONTACT

Get in touch

  • Privacy
  • Terms of service

Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand