You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/23 09:49:48 UTC

svn commit: r1641165 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Author: jleroux
Date: Sun Nov 23 08:49:48 2014
New Revision: 1641165

URL: http://svn.apache.org/r1641165
Log:
It's not quite clear to me why Date.CultureInfo.formatPatterns.longTime from date.js returns ms (always .000 it seems). I don't know if this would not happen, but anyway I prefer to assign the value to the calendar out of the block which changes the value.

Modified:
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1641165&r1=1641164&r2=1641165&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Nov 23 08:49:48 2014
@@ -126,11 +126,11 @@ under the License.
           var initDate = <#if value?has_content>jQuery("#${id}").val()<#else>""</#if>;
           if (initDate != "") {
             var dateFormat = Date.CultureInfo.formatPatterns.shortDate<#if shortDateInput?? && !shortDateInput> + " " + Date.CultureInfo.formatPatterns.longTime</#if>;
-            <#-- The JS date parser doesn't understand the dot before ms in the date/time string. The ms here should be always 0 -->
+            <#-- The JS date parser doesn't understand the dot before ms in the date/time string. The ms here should be always 000 -->
             if (initDate.indexOf('.') != -1) {
               initDate = initDate.substring(0, initDate.indexOf('.'));
-              jQuery("#${id}").val(initDate);
             }
+            jQuery("#${id}").val(initDate);
             var ofbizTime = "<#if shortDateInput?? && shortDateInput>yyyy-MM-dd<#else>yyyy-MM-dd HH:mm:ss</#if>";
             var dateObj = Date.parseExact(initDate, ofbizTime);
             var formatedObj = dateObj.toString(dateFormat);