fixes bug#18492

dev:lucas
qua:junia

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@100404 d1611594-4594-4d17-8e1d-87c2c4800839
master
changelogweb 2020-02-29 21:29:46 +00:00
parent cf7e5ed1c6
commit 5e3a58ddf4
2 changed files with 41 additions and 2 deletions

View File

@ -7,7 +7,6 @@ package com.rjconsultores.ventaboletos.web.utilerias;
import javax.servlet.ServletContext;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.flywaydb.core.Flyway;
import org.quartz.JobDetail;
@ -19,13 +18,13 @@ import org.quartz.TriggerUtils;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.zkoss.lang.Library;
import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.WebApp;
import com.rjconsultores.ventaboletos.FlyWay;
import com.rjconsultores.ventaboletos.entidad.Constante;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.utilerias.Application;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionConferenciaMovimentoJob;
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionCorridaJob;
@ -67,6 +66,10 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit {
Labels.register(new MyLabelLocatorGeneral((ServletContext) wapp.getNativeContext()));
// Labels.register(new MyLabelLocatorCliente((ServletContext) wapp.getNativeContext()));
//Definição do comportamento padrão do Datebox em relação ao formato de data
//Mais informações em -> https://www.zkoss.org/wiki/ZK_Developer's_Reference/Internationalization/Date_and_Time_Formatting
Library.setProperty("org.zkoss.web.preferred.dateFormatInfo", "com.rjconsultores.ventaboletos.web.utilerias.MyDateFormatInfo");
boolean ipBloqueadoGeracaoServico = ipBloqueadoGeracaoServico();
log.info("ipBloqueadoGeracaoServico=" + ipBloqueadoGeracaoServico);

View File

@ -0,0 +1,36 @@
package com.rjconsultores.ventaboletos.web.utilerias;
import java.util.Locale;
import org.zkoss.text.DateFormatInfo;
/**
* Classe que controla a formatação padrão de todos os componentes datebox.
*
* Sua inicialização é feita na classe {@link MyAppInit#init(org.zkoss.zk.ui.WebApp)}
*
* Mais informações em -> https://www.zkoss.org/wiki/ZK_Developer's_Reference/Internationalization/Date_and_Time_Formatting
*
* Caso deseje fazer por user (session): https://www.zkoss.org/wiki/ZK_Developer's_Reference/Internationalization/Locale
*
* @author gleim
*
*/
public class MyDateFormatInfo implements DateFormatInfo {
@Override
public String getDateFormat(int style, Locale locale) {
return "dd/MM/yyyy";
}
@Override
public String getTimeFormat(int style, Locale locale) {
return "hh24:mm";
}
@Override
public String getDateTimeFormat(int dateStyle, int timeStyle, Locale locale) {
return "dd/MM/yyyy hh24:mm";
}
}