本文整理汇总了Java中ch.rgw.tools.TimeTool.daysTo方法的典型用法代码示例。如果您正苦于以下问题:Java TimeTool.daysTo方法的具体用法?Java TimeTool.daysTo怎么用?Java TimeTool.daysTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.rgw.tools.TimeTool
的用法示例。
在下文中一共展示了TimeTool.daysTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDays
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Set the dates of the composite
*
* @param days
* number of days before the basedate
* @param baseDate
* the date to calculate from or null=today
*/
public void setDays(int days){
removeListeners();
ttBase = new TimeTool(ttNow);
ttBase.addDays(days);
dp.setDate(ttBase.getTime());
int diff = ttBase.daysTo(ttNow);
updateLabels(diff);
spinner.setValues(Math.abs(days), 0, 999, 0, 1, 10);
setListeners();
}
示例2: hasShops
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public Boolean hasShops() {
//(1) Check, if we need to update the shops from the WebService
String strCFG = CoreHub.globalCfg.get(Constants.CFG_PHM_LASTREQUEST, "");
TimeTool now = new TimeTool(new Date());
if (strCFG.length() == 0) {
this.shops = getShopsFromWS();
} else {
TimeTool before = new TimeTool(strCFG);
int days = before.daysTo(now);
if (days > 14) {
this.shops = getShopsFromWS();
} else {
this.shops = getShopsFromConfig();
}
}
if (shops.size() == 0) {
return false;
}
return true;
}