@@ -398,6 +398,10 @@ else if("LocalDate".equals(entiteNomSimple)) {
398398 tl (1 , "{%- if 'Page' == " , langueConfig .getString (I18n .var_classeApiMethodeMethode ), " %}" );
399399 tl (1 , "{%- endif %}" );
400400 tl (11 , "data-" , classeVarId , "={{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarId , " | tojson }}" );
401+ if (classeVarZone != null )
402+ tl (11 , "data-zone=\" {{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarZone , " | e }}\" " );
403+ else
404+ tl (11 , "data-zone=\" {{ defaultZoneId }}\" " );
401405 tl (11 , ">" );
402406 tl (9 , "</" , composantsWebPrefixe , "input>" );
403407 }
@@ -427,6 +431,10 @@ else if("LocalDateTime".equals(entiteNomSimple) || "ZonedDateTime".equals(entite
427431 tl (1 , "{%- if 'Page' == " , langueConfig .getString (I18n .var_classeApiMethodeMethode ), " %}" );
428432 tl (1 , "{%- endif %}" );
429433 tl (11 , "data-" , classeVarId , "={{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarId , " | tojson }}" );
434+ if (classeVarZone != null )
435+ tl (11 , "data-zone=\" {{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarZone , " | e }}\" " );
436+ else
437+ tl (11 , "data-zone=\" {{ defaultZoneId }}\" " );
430438 tl (11 , ">" );
431439 tl (9 , "</" , composantsWebPrefixe , "input>" );
432440 }
@@ -457,6 +465,10 @@ else if("LocalTime".equals(entiteNomSimple)) {
457465 tl (11 , "id=\" {{" , langueConfig .getString (I18n .var_classeApiMethodeMethode ), "}}_" , entiteVar , "\" " );
458466 tl (11 , "value=\" {{" , i18nGlobale .getString (I18n .var_resultat ), "." , entiteVar , " | e }}\" " );
459467 tl (11 , "data-" , classeVarId , "={{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarId , " | tojson }}" );
468+ if (classeVarZone != null )
469+ tl (11 , "data-zone=\" {{ " , i18nGlobale .getString (I18n .var_resultat ), "." , classeVarZone , " | e }}\" " );
470+ else
471+ tl (11 , "data-zone=\" {{ defaultZoneId }}\" " );
460472 tl (11 , "></" , composantsWebPrefixe , "input>" );
461473 }
462474 else if ("Boolean" .equals (entiteNomSimple )) {
@@ -1315,9 +1327,10 @@ public void pageCodeClasseJava(String langueNom, JsonObject langueConfig) throws
13151327 wJsEditionInit .tl (9 , ", function(" , langueConfig .getString (I18n .var_reponse ), ", target) { " , langueConfig .getString (I18n .var_ajouterErreur ), "(target); }" );
13161328 wJsEditionInit .tl (9 , ");" );
13171329 } else if ("LocalDateTime" .equals (entiteNomSimple ) || "ZonedDateTime" .equals (entiteNomSimple )) {
1318- wJsEditionInit .tl (7 , "var timeZone = event.currentTarget.value.split('[').pop().split(']')[0];" );
1319- wJsEditionInit .tl (7 , "var t1 = moment(event.currentTarget.value.split('[')[0].trim(), '" , langueConfig .getString (I18n .str_DDDashMMDashYYYY_HHColonmm ), "');" );
1320- wJsEditionInit .tl (7 , "var t2 = moment.tz(event.currentTarget.value.split('[')[0].trim(), '" , langueConfig .getString (I18n .str_DDDashMMDashYYYY_HHColonmm ), "', timeZone);" );
1330+ wJsEditionInit .tl (7 , "var timeZone = event.currentTarget.getAttribute('data-zone');" );
1331+ // wJsEditionInit.tl(7, "var timeZone = event.currentTarget.value.split('[').pop().split(']')[0];");
1332+ wJsEditionInit .tl (7 , "var t1 = moment(event.currentTarget.value, \" YYYY-MM-DDTHH:mm\" );" );
1333+ wJsEditionInit .tl (7 , "var t2 = moment.tz(event.currentTarget.value, \" YYYY-MM-DDTHH:mm\" , timeZone);" );
13211334 wJsEditionInit .tl (7 , "var t3 = new Date(t1._d);" );
13221335 wJsEditionInit .tl (7 , "t3.setTime(t1.toDate().getTime() + t2.toDate().getTime() - t1.toDate().getTime());" );
13231336 wJsEditionInit .tl (7 , "var t = moment(t3);" );
0 commit comments