0
給定爲期一週,我怎樣才能得到本週開始和結束的日期?給定calendar.week_of_year,如何獲取本週開始和結束的日期?
例如: 假設日期爲2017年1月1日。
Calendar calendar = Calendar.getInstance();
// Let's assume that we've set calendar to Jan/1/2017.
Integer week_of_year = calendar.get(Calendar.WEEK_OF_YEAR)
week_of_year will return 1.假定第1周是2017年1月1日至2017年1月7日之間的任何事情。
如何反轉查找week_of_year = 1並獲取2017年1月7日至2017年1月6日的最小/最大值?或任何其他有效的week_of_year值。