Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么获得这个选取的时间呢 #8

Open
zhaojj11 opened this issue Jun 7, 2018 · 2 comments
Open

怎么获得这个选取的时间呢 #8

zhaojj11 opened this issue Jun 7, 2018 · 2 comments

Comments

@zhaojj11
Copy link

zhaojj11 commented Jun 7, 2018

我找了一下 源码 关于源码中 DatePickDialog中没有get方法。请问怎么解决获得选取时间这个问题?

@geekxingyun
Copy link

//设置点击确定按钮回调
dialog.setOnSureLisener(new OnSureLisener() {
@OverRide
public void onSure(Date date) {
healthMonitorHistoryDataEndTimeEditText.setText(SmartDateUtils.dateToStrLong(date));
}
});

日期时间格式化自己写个工具类吧

@checkming
Copy link

//设置点击确定按钮回调
dialog.setOnSureLisener(new OnSureLisener() {
@OverRide
public void onSure(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = sdf.format(date);
((TextView) v).setText(time);
}
});
得到的结果样式如:2018-08-07 16:10:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants