Revision: 4804 http://sourceforge.net/p/vexi/code/4804 Author: mkpg2 Date: 2015-07-05 18:33:44 +0000 (Sun, 05 Jul 2015) Log Message: ----------- Making possible to set default date format using a vexi parameter 'widgets.date_format'.
Modified Paths: -------------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_format.t Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t 2015-07-02 04:10:53 UTC (rev 4803) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t 2015-07-05 18:33:44 UTC (rev 4804) @@ -236,8 +236,13 @@ // initialize selected = $day; - + thisbox.format = "DDMMYYYY"; thisbox.format ++= static.formatWrite; + // MAY try and determine this, e.g. from java locale (would be done in core obviously) + var defaultFormat = vexi.params["widgets.date_format"]; + if(defaultFormat){ + thisbox.format = defaultFormat; + } </bevel> <lib.finalize /> @@ -289,6 +294,9 @@ /** sets the display format */ static.formatWrite = function(v) { + const v0 = trapee[trapname]; + if(v0==v) return; + switch (v) { case "DDMMYYYY": trapee.dateview[0] = trapee.dayview; Modified: branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_format.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_format.t 2015-07-02 04:10:53 UTC (rev 4803) +++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/datefield_format.t 2015-07-05 18:33:44 UTC (rev 4804) @@ -17,6 +17,7 @@ </w:option> <w:datefield id="date4" /> </ui:box> + trace(vexi.params["widgets.date_format"]); $date1.value = vexi.js.Date.today; $date2.value = vexi.js.Date.today; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn