本文整理汇总了Java中hirondelle.date4j.DateTime.getDay方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.getDay方法的具体用法?Java DateTime.getDay怎么用?Java DateTime.getDay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hirondelle.date4j.DateTime
的用法示例。
在下文中一共展示了DateTime.getDay方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEvent
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
/**
* Formatting string representation for a course
* @param i
* @return
*/
private String getEvent(int i) {
DateTime start = agendas.get(i).getStartDate();
DateTime end = agendas.get(i).getEndDate();
String summary = agendas.get(i).getTrimmedTitle() + " ";
//Gives time two digit representation
summary += start.getDay() + ".";
summary += start.getMonth() + " ";
summary += String.format("%02d",start.getHour()) + ":";
summary += String.format("%02d",start.getMinute()) + "-";
summary += String.format("%02d",end.getHour()) + ":";
summary += String.format("%02d",end.getMinute());
return summary;
}
示例2: updateDateAndTimePickers
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
private void updateDateAndTimePickers(DateTime dateTime) {
time.setCurrentHour(dateTime.getHour());
time.setCurrentMinute(dateTime.getMinute());
if (pickersAreInitialized) {
date.updateDate(dateTime.getYear(), dateTime.getMonth() - 1, dateTime.getDay());
} else {
time.setOnTimeChangedListener(this);
date.init(dateTime.getYear(), dateTime.getMonth() - 1, dateTime.getDay(), this);
pickersAreInitialized = true;
// manually set the variables once:
selectedHour = dateTime.getHour();
selectedMinute = dateTime.getMinute();
selectedYear = dateTime.getYear();
selectedMonth = dateTime.getMonth() - 1;
selectedDay = dateTime.getDay();
setWeekday();
}
}
示例3: setDate
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
private void setDate(DateTime dateTime) {
this.date = Long.valueOf(getDateString(dateTime));
this.year = dateTime.getYear();
this.month = dateTime.getMonth();
this.day = dateTime.getDay();
}
示例4: convertDateTimeToDate
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public static Date convertDateTimeToDate(DateTime dateTime) {
int year = dateTime.getYear();
int datetimeMonth = dateTime.getMonth();
int day = dateTime.getDay();
Calendar calendar = Calendar.getInstance();
calendar.clear();
// datetimeMonth start at 1. Need to minus 1 to get javaMonth
calendar.set(year, datetimeMonth - 1, day);
return calendar.getTime();
}
示例5: getInfo
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
private String getInfo(DateTime date) {
int month = date.getMonth();
int day = date.getDay();
int year = date.getYear();
String stringDate = month + "/" + day + "/" + year;
edu.uillinois.wseemann.uicombatschedule.utils.Date obj = (edu.uillinois.wseemann.uicombatschedule.utils.Date) extraData.get(stringDate);
if (obj != null) {
return obj.getInfo();
}
return null;
}
示例6: convertDateTimeToDate
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public static Date convertDateTimeToDate(DateTime dateTime) {
int year = dateTime.getYear();
int datetimeMonth = dateTime.getMonth();
int day = dateTime.getDay();
Calendar calendar = Calendar.getInstance();
calendar.clear();
// datetimeMonth start at 1. Need to minus 1 to get javaMonth
calendar.set(year, datetimeMonth - 1, day);
return calendar.getTime();
}