Upcoming/past dates appear in orange/red - how to turn off?
Asked by Mark Stewart:

We write out release plans in Confluence that include a table where one column is is a date (using the calendar macro where you type "//" then the calendar appears). Something changed this week in our implementation where these dates now change color if they are in the past (bold and red) or upcoming (bold and orange).

We don't want this feature. It appears to have the classes "date-upcoming" and "date-past" which trigger the css changes. How can we turn this off?


Answers:
author: Shannon S
body: Hello everyone!

This is a known bug at this time, and I have reported it here:

* [CONFCLOUD-65700](https://jira.atlassian.com/browse/CONFCLOUD-65700) *Past dates are showing up red (late) when not attached to a* task

Please vote on the bug if you are experiencing it, and watch for any updates going forward.

Thank you for your attention!

Regards,

Shannon


author: Bill Bailey
body: Add rules to the global stylesheet to override those rules.


author: Marinda
body: We would actually prefer the old editor look - we'd like the upcoming dates to show up in orange and past dates in red. Is there any way we can make that happen in the new editor?

comments: author: Henrik Juel Petersen
body: Did you find a way to do this?


author: Shannon S
body: Hi [@Marinda](/t5/user/viewprofilepage/user-id/1590532) and [@Henrik Juel Petersen](/t5/user/viewprofilepage/user-id/3526621),

I've logged a feature request below to bring this feature to the new editor:

* [CONFCLOUD-68345](https://jira.atlassian.com/browse/CONFCLOUD-68345) *Display past and approaching dates in date macro in orange and red*

Please vote on the request and you will be automatically added to the list of watchers and receive updates on this in the future.

Regards,

Shannon


author: Henrik Juel Petersen
body: Hi,  

I made a quick and dirty solution, where I made a user macro, that adds an id to a \<p\> tag and then takes a date as input and place it inside the \<p\> tag with a "time datetime" that triggers the date picker style of dates.

This way I can control, that it's only coloring the dates, where I use the usermacro, instead of the whole confluence instance, which it did - when I just added the chages to CSS(without the dateExpire id)..

Unfortunately I could only get it to work with the date format: MM/dd/yyyy.

User macro:

"No macro body"

## [@Param](/t5/user/viewprofilepage/user-id/1345631) inputDate:title=Input date\|type=date\|desc=Format: MM/dd/yyyy  
#set($inputDate=$content.currentDate)  
$inputDate.setTime($content.currentDate.parse($paraminputDate))  
\<p id="dateExpire"\>\<time datetime="$action.dateFormatter.formatGivenString("yyyy-MM-dd", $inputDate)"/\>\</p

(The user macro is inspired by some other macro I found somewhere in the community)

Added following to the CSS stylesheet in the general configuration:  
p#dateExpire.conf-macro.output-inline time.date-past { color:red }

There's also the date classes: date-future and date-upcomming

Im not sure, when a date-future becomes a date-upcomming - but I'm guessing its the same old rules that has always been there.

Hope you can use it to some extend - even tho it's not an optimal solution.

/Henrik


author: Shannon S
body: Henrik,

Thank you for sharing your workaround. Unfortunately, this thread is regarding Confluence Cloud, so it's not possible to use User Macros in Cloud.

Although, if someone comes across this that wants to do the same on Server, it should be able to help them.

Thank you, and take care!

Regards,

Shannon


author: Suren Raj
body: Hi, [@Mark Stewart](/t5/user/viewprofilepage/user-id/1888350)

I understand you see different date colors while using the date picker in Confluence. As of now, there are two editors in Confluence: old editor and the new editor.

**In the old editor**: When you use date picker here, all the past dates chosen are red in color, the present one week is orange and any futures dates are grey.

**In the new editor**: When you use date picker here, all the dates no matter past or present are a grey color.

As of now, your instance seems to be using the old editor. That being said, at this point, 90% of the customers have the new editor template enabled and for the rest 10%, it will be rolled out soon. Once this is done you will not see any difference in the color for dates.  

Regards,  
Suren Raj

comments: author: Marinda
body: We would actually prefer the old editor look - we'd like the upcoming dates to show up in orange and past dates in red. Is there any way we can make that happen in the new editor?


author: Bill Bailey
body: [@Mark Stewart](/t5/user/viewprofilepage/user-id/1888350)had both versions tagged, so not clear if Cloud or not. But if Cloud, they make it much harder than with the server version.


author: Davin Studer
body: Looks like it is for Cloud though. However, there is a style macro in Cloud. You could override it on a page by page basis. Or maybe put the styles into a page and then include that page onto pages where you have dates. That way you don't have to type out the styles each time.


Tags: cloud

confluence-cloud