📄 dateeditor.java
字号:
package com.spring.controller;
import java.beans.PropertyEditorSupport;
import java.sql.Date;
public class DateEditor extends PropertyEditorSupport {
public String getAsText() {
Object o = getValue();
if (o == null || !(o instanceof Date)) {
return null;
}
return o.toString();
}
public void setAsText(String text) throws IllegalArgumentException {
Date date;
if (text != null && text != "")
date = Date.valueOf(text);
else
date = new Date(System.currentTimeMillis());
setValue(date);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -