Skip to main content

Inputting & Formatting dates

There are a number of ways that dates can be called and formatted using Gizmo in orgvue

important

Functions must be captialised as shown

Input Datesโ€‹

Dates in Orgvue Gizmo may be entered in the following formats

  • yyyy,mm,dd
  • yyyy-mm-dd (ISO Format)
  • Calling a Date Property
  • Use of the now() or today() functions

Unlike JavaScript Date, where month is zero indexed, in Gizmo January is month 1

Nowโ€‹

now() returns the current date and time UTC

image

Todayโ€‹

today() returns the current date UTC

image

Day Of Weekโ€‹

.dayOfWeek Returns the day of the week for an Input Date, as an integer

node.dateOfBirth.dayOfWeek

image

Day Of Monthโ€‹

.dayOfMonth Retunrs the day of the month for an Input Date, as an integer

date(2020,10,30).dayOfMonth

image

Day Of Yearโ€‹

.dayOfYear Returns the day of the year it falls on for an Input Date, as an integer

node.dateOfBirth.dayOfYear

image

Monthโ€‹

.month Returns the month of the calendar year for an Input Date, as an integer

today().month

image

Quarterโ€‹

.quarter Returns the quarter of the year it falls on for an Input Date, as an integer

date(2022,10,30).quarter

image

Yearโ€‹

.year Returns a date as year it falls in as an integer

node.dateOfBirth.year

image

Format Datesโ€‹

Any Input Dates can be formatted with format() so that it returns a string (text) in the specified format

date(2022, 8, 3).format("EEEE, MMMM do yyyy")

Returns Wednesday, August 3rd 2022

image

date(2022, 8, 3).format("d MMM yy")

Returns 3 Aug 22

image

Date Format Optionsโ€‹

The string that is returned can be configured in many ways

The format tokens supported and the output format are listed below

The tokens should be entered within the () of the format() function, enclosed in " " with any delimiters also included

e.g.

date(2022, 8, 3).format("d/MMM/yy")

Returns 3/Aug/22

tokenvalue
Month
M1, 2, ..., 12
Mo1st, 2nd, ..., 12th
MM01, 02, ..., 12
MMMJan, Feb, ..., Dec
MMMMJanuary, February, ..., December
Quarter
Q1, 2, 3, 4
Qo1st, 2nd, 3rd, 4th
QQQ1, Q2, Q3, Q4
QQQQ1st Quarter, 2nd Quarter, 3rd Quarter, 4th Quarter
Day of month
d1, 2, ..., 31
do1st, 2nd, ..., 31st
dd01, 02, ..., 31
Day of year
DDD001, 002, ..., 366
DDDo1st, 2nd, ..., 366th
DDDD0001, 0002, ..., 366
Day of weekW/C Sunday
e1, ..., 7
eo1st, ..., 7th
ee01....07
ESun, Mon, ..., Sat
EEEESunday, Monday, ..., Saturday
Day of weekW/C Monday
i1, ..., 7
io1st, ..., 7th
ii01....07
iiiMon, Tue.....,Sun
iiiiMonday, Tuesday.....,Sunday
ISO Week Number
w1, 2, ..., 53
ww01, 02,....,52
wo1st, 2nd, ..., 53rd
Gregorian Week Number
I1, 2, ..., 53
II01, 02,....,52
Io1st, 2nd, ..., 53rd
Year
yy00, 01, ..., 99
yyyy1900, 1901, ..., 2099
Preset Formats
Pmm/dd/yyyy e.g. 08/21/1993
PPMMM dd yyyy e.g. Aug 21 1993
PPPMMMM Do yyyy e.g. August 21st 1993
PPPPEEEE, MMMM do yyyy e.g. Saturday, August 21st 1993