Bridge To JIRA - configure datetime format

Configuring of a particular format for the datetime displayed by the Bridge to JIRA plugin is done using a classic WordPress filter.

The easiest is to have a parallel plugin of a few lines of code that will just add and implement the filter.

The filter name is btj_filter_datetime_format and it receives as input a PHP date. The implemented filter should transform this date into a printable string.

Here's a sample of what this filter may be:

add_filter('btj_filter_datetime_format', 'cbtj_datetime_format');

function cbtj_datetime_format($date) {
return date('Y/d/m H:i', $date);
}

 

The the following shortcode will display the datetime of the created JIRA issues in the desired format:

[btj-table fields="key,assignee,created" id="demonstrate-datetime-format"]project = DBTJ[/btj-table]

keyAssigneeCreated
DBTJ-1082023/04/09 17:58
DBTJ-1072023/30/08 15:44
DBTJ-1062023/30/08 15:34
DBTJ-105 John Doe2023/02/07 12:51
DBTJ-104 John Doe2023/02/07 12:45
DBTJ-1032023/01/07 06:29
DBTJ-1022023/01/07 06:23
DBTJ-1012023/06/03 15:46
DBTJ-1002023/22/01 20:43
DBTJ-992023/20/01 07:42
DBTJ-982023/03/01 10:49
DBTJ-972022/28/12 15:01
DBTJ-962022/28/12 08:40
DBTJ-65 Cosmin Cremarenco2022/28/10 14:11
DBTJ-15 Jane Doe2022/31/07 11:50
DBTJ-14 John Doe2021/18/05 09:11
DBTJ-13 John Doe2021/19/04 14:28
DBTJ-12 Jane Doe2021/16/03 19:16
DBTJ-11 Cosmin Cremarenco2021/02/01 14:19
DBTJ-10 John Doe2021/02/01 09:41
DBTJ-9 John Doe2021/02/01 09:28
DBTJ-8 John Doe2021/02/01 09:20
DBTJ-7 John Doe2020/29/12 19:04
DBTJ-6 John Doe2020/29/12 17:25
DBTJ-5 John Doe2020/29/12 17:24
DBTJ-4 John Doe2020/29/12 17:22
DBTJ-3 John Doe2020/29/12 17:20
DBTJ-2 Jane Doe2020/29/12 17:20
DBTJ-1 Jane Doe2020/29/12 17:09

Leave a comment

Your email address will not be published.