本文整理汇总了Java中com.google.gwt.user.datepicker.client.CalendarUtil.setToFirstDayOfMonth方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarUtil.setToFirstDayOfMonth方法的具体用法?Java CalendarUtil.setToFirstDayOfMonth怎么用?Java CalendarUtil.setToFirstDayOfMonth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.datepicker.client.CalendarUtil
的用法示例。
在下文中一共展示了CalendarUtil.setToFirstDayOfMonth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMonthsToDateSafe
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
/**
* it's behavior is like Calendar's addmonth(), but it works fine
*
* @param date
* @param delta
*/
@SuppressWarnings("deprecation")
public static void addMonthsToDateSafe(Date date, int delta) {
int h = date.getHours();
int m = date.getMinutes();
int s = date.getSeconds();
int d = date.getDate() - 1;
CalendarUtil.setToFirstDayOfMonth(date);
CalendarUtil.addMonthsToDate(date, delta);
int month = date.getMonth();
while (d > 0 && date.getMonth() == month) {
CalendarUtil.addDaysToDate(date, 1);
d--;
}
if (date.getMonth() != month) {
CalendarUtil.addDaysToDate(date, -1);
}
date.setHours(h);
date.setMinutes(m);
date.setSeconds(s);
}
示例2: isBeforeMinMonth
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
public boolean isBeforeMinMonth(Date month) {
if(!isRangeSet()) return false;
Date minMonth = CalendarUtil.copyDate(minDate);
CalendarUtil.setToFirstDayOfMonth(minMonth);
return month.before(minMonth);
}
示例3: isAfterMaxMonth
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
public boolean isAfterMaxMonth(Date month) {
if(!isRangeSet()) return false;
Date maxMonth = CalendarUtil.copyDate(maxDate);
CalendarUtil.setToFirstDayOfMonth(maxMonth);
return month.after(maxMonth);
}
示例4: lastDayOfMonth
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
private Date lastDayOfMonth(Date month) {
Date lastDay = (Date) month.clone();
CalendarUtil.addMonthsToDate(lastDay, 1);
CalendarUtil.setToFirstDayOfMonth(lastDay);
CalendarUtil.addDaysToDate(lastDay, -1);
return justDay(lastDay);
}
示例5: firstDayOfMonth
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
private Date firstDayOfMonth(Date month) {
Date firstDay = (Date) month.clone();
CalendarUtil.setToFirstDayOfMonth(firstDay);
return justDay(firstDay);
}