本文整理汇总了Java中com.google.gwt.user.datepicker.client.CalendarUtil.isSameDate方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarUtil.isSameDate方法的具体用法?Java CalendarUtil.isSameDate怎么用?Java CalendarUtil.isSameDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.datepicker.client.CalendarUtil
的用法示例。
在下文中一共展示了CalendarUtil.isSameDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildOverlay
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
@Override
public JavaScriptObject buildOverlay(Message prev, Message current, Message next) {
Date nextDate = next != null ? new Date(next.getDate()) : null;
Date currentDate = new Date(current.getDate());
boolean showDate;
String dateDiv = null;
if (next != null) {
showDate = !CalendarUtil.isSameDate(nextDate, currentDate);
} else {
showDate = true;
}
if (showDate) {
dateDiv = JsMessenger.getInstance().getFormatter().formatMonth(currentDate);
}
boolean useCompact = false;
if (next != null && !showDate) {
if (next.getSenderId() == current.getSenderId()) {
if (next.getDate() - current.getDate() < 10 * 60 * 1000) {
useCompact = true;
}
}
}
return JsMessageOverlay.create(useCompact, dateDiv);
}
示例2: isEmpty
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
/**
* to decide what textbox component contains date information
*
* @param precision
* @return
*/
public boolean isEmpty(Precision precision) {
switch (precision) {
case YOO_OO:
return "1".equals(precision.getFormatter().format(date));
case YMO_OO:
return "1.1".equals(precision.getFormatter().format(date));
// FIXME
case YMD_OO:
return "0001.01.01".equals(precision.getFormatter().format(date))
|| "0000.12.30".equals(precision.getFormatter().format(date)); // don't
// know
// what
// happens
// in
// compiled
// code
case YMD_HM:
return CalendarUtil.isSameDate(date, new Date(NULLDATE));
case OMO_OO:
case OOO_HM:
case OOO_HO:
case OOO_OM:
case OOO_HMS:
return false;
}
throw new RuntimeException(
"IneDateGWT: isEmpty(): there is no case for: " + precision.toString());
}
示例3: onClick
import com.google.gwt.user.datepicker.client.CalendarUtil; //导入方法依赖的package包/类
@Override
public void onClick(ClickEvent event) {
if (enabled) {
if (!CalendarUtil
.isSameDate(inedate.getDateClone(), new Date(IneDateGWT.NULLDATE))) {
datepicker.setCurrentMonth(inedate.getDateClone());
datepicker.setValue(inedate.getDateClone());
} else {
datepicker.setCurrentMonth(dateProv.getDate(System.currentTimeMillis()));
datepicker.setValue(dateProv.getDate(System.currentTimeMillis()));
}
popup.showRelativeTo(img_calendar);
}
}