How to remove the automatic date format

mstrubberg
Posts: 48
Joined: Sat Jan 26, 2013 6:07 pm

How to remove the automatic date format

Post by mstrubberg » Mon Apr 15, 2013 9:49 pm

In Oxygen 14.2, the prolog>critdates>created element has an automatic date attribute format of YYYY-MM-DD. If the date format is entered as DD Month YYYY, the document no longer is valid as this date format is not valid. Although the DITA 1.2 language spec recommends the format YYYY-MM-DD, the date attribute is a CDATA field that is not required, so why does it throw a validation error if the format is other than YYYY-MM-DD?

Radu
Posts: 6592
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to remove the automatic date format

Post by Radu » Tue Apr 16, 2013 1:24 pm

Hi,

The specs:

http://docs.oasis-open.org/dita/v1.2/os ... vised.html

says for such an attribute something like:

Code: Select all

The publication or general availability (GA) date, entered as YYYY-MM-DD, where YYYY is the year, MM is the month from 01 to 12, and DD is the day from 01-31.
so to me it seems quite mandatory. Indeed the attribute value is defined as CDATA but the description of the attribute seems quite clear. Maybe you should also write about this on the DITA Users List, maybe we can get some feedback from Eliot Kimber or others who wrote the specification.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Radu
Posts: 6592
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to remove the automatic date format

Post by Radu » Tue Apr 16, 2013 1:28 pm

The CSS in which the date picker is defined:

OXYGEN_INSTALL_DIR/frameworks/dita/css_classed/topic.css

, search for *[class~="topic/created"]:after and *[class~="topic/revised"]:after

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

jzucker
Posts: 4
Joined: Wed Oct 15, 2014 10:22 pm

Re: How to remove the automatic date format

Post by jzucker » Tue Dec 20, 2016 11:16 pm

Hi oXygen team,

Does this still apply?

I am trying to remove the date picker altogether. I have a requirement to modify the date format to include seconds and time zone. I need to change the date format to "yyMMddHHmmssZ"

I modified the oxy_datePicker option. This had no effect. I also turned it off completely in Preferences > Code Templates. The date picker still shows when authoring in a topic. I also commented out the date picker code in OXYGEN_INSTALL_DIR/frameworks/dita/css_classed/topic.css. None of these have any effect.

Is there a way to override this setting?

Thanks!

Joe

Radu
Posts: 6592
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to remove the automatic date format

Post by Radu » Wed Dec 21, 2016 9:07 am

Hi Joe,

So you want to remove the datepicker presented for the DITA created element, right?
If you are using Oxygen 17.0 or newer you can select the element in the Outline, then right click the selected element in the Author visual editor and choose Inspect Styles.
The CSS Inspector view should show you all CSS styles applied on the element (there are separate tabs for before and after styles). And it also lets you open the CSS stylesheets exactly at the place where each selector is defined.
The *[class~="topic/created"]:before CSS selector you are looking for should be in the OXYGEN_INSTALL_DIR\frameworks\dita\css\core\-topic-metadata-prolog.css but its location might depend on the Oxygen version and on whether or not you are using a custom DITA framework.
So the CSS inspector is quite useful to debug such cases.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Lemesany
Posts: 18
Joined: Wed Jan 25, 2017 11:21 pm

Re: How to remove the automatic date format

Post by Lemesany » Mon Feb 06, 2017 10:38 pm

Radu wrote:... but its location might depend on the Oxygen version and on whether or not you are using a custom DITA framework.
Hi Radu, where in the custom framework should this be saved? When you are editing the framework's preferences, I mean? I try to save it in the CSS tab from "Author" but that doesn't seem to be the right location.

Lemesany
Posts: 18
Joined: Wed Jan 25, 2017 11:21 pm

Re: How to remove the automatic date format

Post by Lemesany » Mon Feb 06, 2017 11:19 pm

I spoke too soon - placing it in the CSS location I mentioned actually did work. Thanks!

Post Reply