Here you can find the source of getTrendTime(Date date)
public static Date[][] getTrendTime(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date[][] getTrendTime(Date date) { Date[][] dates = new Date[6][2]; Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from ww w . j a v a2s . c om*/ calendar.set(Calendar.DAY_OF_MONTH, 0); dates[5][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[5][0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 0); dates[4][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[4][0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 0); dates[3][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[3][0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 0); dates[2][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[2][0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 0); dates[1][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[1][0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 0); dates[0][1] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, 1); dates[0][0] = calendar.getTime(); return dates; } }