toJiraDateFormat

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Availability

This routine is available starting with katl-commons 4.0.10.

Syntax

toJiraDateFormat(date_as_string, [includeTime]);

Description

Displays the given date using Jira format.

Parameters

Parameter name

Type

Required

Description

date_as_string

string

Yes

Date given as a string that will be converted to Jira format.

includeTimebooleanNo

"True" if you want to include the time to the new format and "false" if not.

Return type

string

The return value represents the converted date.

Example

Example 1

Let's consider the following SIL code:

return toJiraDateFormat("2017-04-19", true);

This will return: 19/Apr/17 12:00 AM

The expected format for the date_as_string parameter when includeTime is true is "yyyy-MM-dd hh:mm".

Example 2

By running this code:

return toJiraDateFormat("2017-04-19", false);

The result will be: 19/Apr/17

The expected format for the date_as_string parameter when includeTime is false is "yyyy-MM-dd".

Example 3

By running this code:

return toJiraDateFormat("2017-04-19");

The result will be: 19/Apr/17

See also