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

DatimeWheelLayout 开始时间范围设为1年1月1日 0 时0分 年份显示会显示1001 不是1 #348

Open
anxiaojin opened this issue Dec 25, 2023 · 0 comments

Comments

@anxiaojin
Copy link

     val parseDate1 = DateFormatUtil.parseDate("${1}-${1}-${1} ${0}:${0}")
       val parseDate2 = DateFormatUtil.parseDate("${10000}-${1}-${1} ${0}:${0}")
       val startTime = DatimeEntity.now()
       val endTime = DatimeEntity.now()
       startTime.date = DateEntity.target(parseDate1)
       endTime.date = DateEntity.target(parseDate2)
       startTime.time = TimeEntity.target(parseDate1)
       endTime.time = TimeEntity.target(parseDate2)
       binding.dwl.setRange(startTime, endTime)

 private static final DateFormat FORMAT_DATE_WITH_MINUTE = new SimpleDateFormat("yyyy-MM-dd HH:mm");

   public static Date parseDate(String dateStr) {
       try {
           return FORMAT_DATE_WITH_MINUTE.parse(dateStr);
       }catch (Exception e){
           return new Date();
       }
   }
@anxiaojin anxiaojin changed the title DatimeWheelLayout时间设为1年1月1日 0 时0分 年份显示会显示1001 不是1 DatimeWheelLayout 开始时间范围设为1年1月1日 0 时0分 年份显示会显示1001 不是1 Dec 25, 2023
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

1 participant