Autofill with Current Date

Are you missing a feature? Request its implementation here.
SixForty
Posts: 9
Joined: Sun May 09, 2021 7:34 am

Autofill with Current Date

Post by SixForty »

(I'm putting this here because I don't believe it's possible to do this. If it is, I'd be happy if someone can explain to me how.)

I'm wondering if it would be possible to add some type of "current date" option for the Content Completion Assistant in Text Mode when an attribute's data type is defined in a Schema as xs:date (or similar)

I work a lot in the Text Mode of OxygenXML Editor, dealing directly with the XML files in a growing project. I'm trying to integrate some tracking data, and being able to autofill an attribute with the current date, instead of always having to type in the date, would be a very nice benefit.

Thanks for the consideration!
Radu
Posts: 7779
Joined: Fri Jul 09, 2004 5:18 pm

Re: Autofill with Current Date

Post by Radu »

Hi,

In Oxygen we have support to define and use code templates:
https://www.oxygenxml.com/doc/versions/ ... ting2.html

A code template defines a small piece of XML and it can later be used when pressing "Ctrl-Space" in the editor.
Inside code templates you can use Oxygen editor variables which get automatically expanded when the code template is inserted:
https://www.oxygenxml.com/doc/versions/ ... ables.html
For example you can use our "date" editor variable with a certain pattern:

Code: Select all

<created date="${date(yyyy-MM-dd)}"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SixForty
Posts: 9
Joined: Sun May 09, 2021 7:34 am

Re: Autofill with Current Date

Post by SixForty »

Two things:

First, I guess I should have spent more time digging. I might have been able to piece this together. Sorry to take up your time.

Second, Radu, you are awesomeness personified, and my new best friend. You gave me a solution that is exactly what I was looking for, except one step better. Thanks so much!
Post Reply