Java - How to calculate the first and last day of each week

前端 未结 11 1016
难免孤独
难免孤独 2020-12-05 05:16

I\'m trying to create a weekly calendar that looks like this: http://dhtmlx.com/docs/products/dhtmlxScheduler/sample_basic.html

How can I calculate every week date?

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 05:59

    First day of this week.

        Calendar c = Calendar.getInstance();
        while (c.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
            c.add(Calendar.DATE, -1);
        }
    

提交回复
热议问题