前端日期插件后端解析步骤
@if(isNotEmpty(mydetil.birthday)){
<label class="label-title">生日:
<input id="Text1" name="" onClick="calendar.show({id:this })" type="text" value="${mydetil.birthday,'yyyy-MM-dd'}"/>
</li>@}else{
<label class="label-title">生日:
<input id="Text1" onClick="calendar.show({id:this })" type="text" />
@}
大致格式为TUR.xxxx.xxx.xxx.'yyyy-MM-dd'之类的记不清了。
现在说下后端如何转换的吧
@RequestMapping(value ="/person/mysetting/updateall")
@ResponseBody
public ResultupdateAll(TO7xzMysetting mysetting,@RequestParam @DateTimeFormat(pattern="yyyy-MM-dd") Date day)throws ParseException {
SimpleDateFormat sdf =new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", java.util.Locale.US);
Date parse1 = sdf.parse(day.toString());
System.out.println(parse1);
mysetting.setBirthday(parse1);
// Integer phon=Integer.valueOf(phone);
// mysetting.setPhonenumber(phon);
int i=0;
i=mySettingService.updateAll(mysetting);
System.out.println(mysetting);
if (i>0){
return Result.build(200,"保存成功");
}else {
return Result.build(400,"保存失败");
}
}