Commit d10e72c0 authored by 李家智's avatar 李家智
Browse files

日期类型多种支持

parent ec708bba
......@@ -118,6 +118,15 @@ public class BeetlConf {
});
groupTemplate.registerFunction("abcd", new Function() {
@Override
public Boolean call(Object[] paras, Context ctx) {
return true;
}
});
groupTemplate.registerFunction("env", new Function() {
@Override
......
......@@ -4,6 +4,7 @@ import java.io.IOException;
import java.text.SimpleDateFormat;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -19,6 +20,7 @@ import com.ibeetl.admin.core.web.JsonResult;
@Configuration
public class JasonConfig {
@Bean
@ConditionalOnMissingBean(ObjectMapper.class)
public ObjectMapper getObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
......@@ -34,7 +36,7 @@ public class JasonConfig {
* @author xiandafu
*
*/
static class CustomJsonResultSerializer extends JsonSerializer<JsonResult> {
public static class CustomJsonResultSerializer extends JsonSerializer<JsonResult> {
public CustomJsonResultSerializer() {
}
......
......@@ -92,6 +92,7 @@ public class MVCConf implements WebMvcConfigurer, InitializingBean {
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addFormatter(new DateFormatter("yyyy-MM-dd HH:mm:ss"));
registry.addFormatter(new DateFormatter("yyyy-MM-dd"));
}
......
......@@ -185,6 +185,14 @@ var Lib = {
range : ''
});
})
$(form).find(".input-date").each(function() {
laydate = layui.laydate;
laydate.render({
elem : $(this)[0],
});
})
},
_dropdown : function(layuiForm, data, form, select, groupName) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment