How to convert a text date into a formatted date for multiple values in a table?

oaguirre
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2019

We handle a lot of tables with a lot of dates in the text format: DD-MM-YYYY or MM-DD-YYYY. I know I can add a date to a cell with //mm-dd-yyyy, but doing this one by one for two columns of 300+ values is kind of hard, so I'd like to know if anyone has done this, if there is a procedure to convert this:

date-to-format-1.png

into this:

date-to-format-2.png

for all the cells in those columns, of course, these are two columns from a larger table, with about 10 other columns with devices information, i.e. name, description, S/N, P/N, address, country, etc...

If it can be done when I'm pasting the table from the source, the xls file, that could also work, I just need the dates to be in that format so it's clear to everyone which date 02-04-2019 is (April 2nd or Feb 4th?) reading the table.

thanks in advance

 

2 answers

1 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2019

Hello @oaguirre,

You'll need to call the macro directly, but you can do so using an add-on from Atlassian Marketplace to edit the source, such as Source Editor for Confluence.

You'll need enter the following in the Source Editor when you want to call a date macro:

<p><time datetime="YYYY-MM-DD" /> </p>

If I had a variety of date formats as you do, I would probably set up the cells in Excel so that when I enter a date it will automatically format the date to match what Confluence requires. You can then wrap the results in the the above formatting and directly edit your page using the Source Editor above.

You may be able to come up with a way to automatically format a list of dates as you have to the HTML table that you need to enter in the source editor, but unfortunately that's not something I'll be able to help you with on this end.

Let me know if you have any questions.

Regards,

Shannon

0 votes
priyanshi shah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 22, 2023

Hello @oaguirre ,

Where you able to resolve this problem? I am also facing the same issue. My concern is also I  have lot of dates scatter all over the page and cannot change in  each in above mention format (in answer) using source editor. Anything where we can place IF..then loop where it automatically pick confluence's formatted date would be more easier.

Please suggest.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events