Date object deprecations in Java 1.5 migrating to Calendar object
Will Cascade server be providing access to the Calendar object if there is a move to Java 1.6? Our site is currently using Date object methods to reformat dates, and we're beginning to notice a lot of the methods available in the Date object. Our main concern is still have access to these methods, that have mograted to the Calendar object as of Java 1.5
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Brent Arrington on 28 Oct, 2010 07:18 PM
You can access an instance of a Calendar object in either Java 1.5 or 1.6 in Cascade currently, via
$_DateTool.getCalendar()
. This will return a Calendar instance preset with the current system date/time. You may then use any of the Calendar get/set/add/etc methods.One note, however: I know of no way to access the static constant values in Calendar (if anyone out there has managed this, please let me know). So, this code will not work:
However, the following will work:
You can find a list of all the constant values for Calendar here
2 Posted by Brent Arrington on 28 Oct, 2010 07:22 PM
Oh, incidentally, I was assuming you meant accessing Calendar from Velocity formats in Cascade... Upon a second reading, I can see that might not be what you were asking...
3 Posted by walshcj on 02 Nov, 2010 09:37 PM
No, that is exactly what I was looking for, thank you.
Tim closed this discussion on 04 Nov, 2010 04:45 PM.