Frontend Macros External Macros - Crocoblock/jetformbuilder GitHub Wiki

Table of Contents

%CT::CurrentDate%

Returns the timestamp. This is a replacement for Date.now()

Example

For Date Field. Quotation marks are required

'%CT::CurrentDate|toDate%'

Result

'2022-10-22'

For Datetime Field. Quotation marks are required

'%CT::CurrentDate|toDateTime%'

Result

'2022-10-22T17:49'

For Time Field. Quotation marks are required

'%CT::CurrentDate|toTime%'

Result

'17:49'

%CT::Min_In_Sec%

Returns the number of milliseconds in one minute.

Example

Getting the difference between dates in minutes.

(%some_date_field|T% - %another_date_field|T%) / %CT::Min_In_Sec%

%CT::Hour_In_Sec%

Returns the number of milliseconds in one hour

Example

Getting the difference between dates in hours.

(%some_date_field|T% - %another_date_field|T%) / %CT::Hour_In_Sec%

%CT::Day_In_Sec%

Returns the number of milliseconds in one day

Example

Getting the difference between dates in days.

(%some_date_field|T% - %another_date_field|T%) / %CT::Day_In_Sec%

%CT::Month_In_Sec%

Returns the number of milliseconds in one month

Example

Getting the difference between dates in months.

(%some_date_field|T% - %another_date_field|T%) / %CT::Month_In_Sec%

%CT::Year_In_Sec%

Returns the number of milliseconds in one year

Example

Getting the difference between dates in years.

(%some_date_field|T% - %another_date_field|T%) / %CT::Year_In_Sec%

Useful links

:small_orange_diamond: View source of current page