Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

android - Set Date range from a specific date instead of month in CalendarView

https://github.com/kizitonwose/CalendarView

I have been using this library for setting up an horizontal calendar view. In this library they set Date range like this:-

  val currentMonth = YearMonth.now()
      
  binding.mainSingleRowCalendar.setup(
      currentMonth,
      currentMonth.plusMonths(2),
      DayOfWeek.values().random()
  )

Here the month is used to set the date range. i need it to be a specific date. Is there any work around? My actual requirement is to show past 30 days from current date.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

of(int year, int month) method

Obtains an instance of YearMonth from a year and month.

YearMonth.of(2021,9) // Sample

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...