Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347399 - [templates] Add date component variable (month, day) to the Code/Editor Templates Variables
Summary: [templates] Add date component variable (month, day) to the Code/Editor Templ...
Status: CLOSED DUPLICATE of bug 75981
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 02:53 EDT by Martin Ahrer CLA
Modified: 2011-05-27 05:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Ahrer CLA 2011-05-27 02:53:34 EDT
Currently code template variables offer variables ${date} and ${year}. However in an environment where file headers contain a date (of creation) the needs to follow a fixed pattern (e.g. YYYY-MM-DD) the date can only be composed by something like ${year}-${month}-${day}.
So it would be helpful to have those additional variables.

Alternatively to adding new variables I could imagine that the templates support evaluating simple Java code snippets like:

"DateFormat.getDateInstance().format(new java.util.Date())"

This would open up a lot of opportunities to extend templates.
Comment 1 Dani Megert CLA 2011-05-27 05:07:24 EDT

*** This bug has been marked as a duplicate of bug 75981 ***