Created
October 23, 2009 09:40
-
-
Save robi42/216778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add formatting convenience method on java.util.Date: | |
var JDate = helma.engine.extendJavaClass(java.util.Date); | |
JDate.prototype.format = function (formatString) { | |
var sdf = new java.text.SimpleDateFormat(formatString); | |
return sdf.format(this); | |
}; | |
// Enable for-(each-)in looping on java.util.Map: | |
var Map = helma.engine.extendJavaClass(java.util.Map); | |
Map.prototype.__iterator__ = function () { | |
return Iterator(this.entrySet()); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment