本文整理汇总了Java中hirondelle.date4j.DateTime.getYear方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.getYear方法的具体用法?Java DateTime.getYear怎么用?Java DateTime.getYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hirondelle.date4j.DateTime
的用法示例。
在下文中一共展示了DateTime.getYear方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
示例2: 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();
}
示例3: setCalendarDateTime
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public void setCalendarDateTime(DateTime dateTime) {
month = dateTime.getMonth();
year = dateTime.getYear();
// Notify listener
if (caldroidListener != null) {
caldroidListener.onChangeMonth(month, year);
}
refreshView();
}
示例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: setCalendarDateTime
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public void setCalendarDateTime(DateTime dateTime) {
month = dateTime.getMonth();
year = dateTime.getYear();
// Notify listener
if (caldroidListener != null) {
caldroidListener.onChangeMonth(month, year);
}
refreshView();
}
示例7: 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();
}
示例8: retrieveInitialArgs
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
protected void retrieveInitialArgs() {
// Get arguments
Bundle args = getArguments();
if (args != null) {
// Get month, year
month = args.getInt(MONTH, -1);
year = args.getInt(YEAR, -1);
// Get start day of Week. Default calendar first column is SUNDAY
startDayOfWeek = args.getInt(START_DAY_OF_WEEK, 1);
if (startDayOfWeek > 7) {
startDayOfWeek = startDayOfWeek % 7;
}
int orientation = getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_PORTRAIT) {
squareTextViewCell = args.getBoolean(SQUARE_TEXT_VIEW_CELL, true);
} else {
squareTextViewCell = args.getBoolean(SQUARE_TEXT_VIEW_CELL, false);
}
// Get disable dates
ArrayList<String> disableDateStrings = args
.getStringArrayList(DISABLE_DATES);
if (disableDateStrings != null && disableDateStrings.size() > 0) {
disableDates.clear();
for (String dateString : disableDateStrings) {
DateTime dt = CalendarHelper.getDateTimeFromString(
dateString, "yyyy-MM-dd");
disableDates.add(dt);
}
}
// Get selected dates
String selectedDateString = args
.getString(SELECTED_DATES);
if (selectedDateString != null ) {
clearSelectedDates();
selectedDate = CalendarHelper.getDateTimeFromString(
selectedDateString, "yyyy-MM-dd");
}
// Get min date and max date
String minDateTimeString = args.getString(MIN_DATE);
if (minDateTimeString != null) {
minDateTime = CalendarHelper.getDateTimeFromString(
minDateTimeString, null);
}
String maxDateTimeString = args.getString(MAX_DATE);
if (maxDateTimeString != null) {
maxDateTime = CalendarHelper.getDateTimeFromString(
maxDateTimeString, null);
}
// Get theme
themeResource = args.getInt(THEME_RESOURCE, R.style.CaldroidDefault);
}
if (month == -1 || year == -1) {
DateTime dateTime = DateTime.today(TimeZone.getDefault());
month = dateTime.getMonth();
year = dateTime.getYear();
}
}
示例9: setAdapterDateTime
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public void setAdapterDateTime(DateTime dateTime) {
this.month = dateTime.getMonth();
this.year = dateTime.getYear();
this.datetimeList = CalendarHelper.getFullWeeks(this.month, this.year,
startDayOfWeek);
}
开发者ID:maheswaranapk,项目名称:Andorid-Material-Drop-Down-Date-Picker,代码行数:7,代码来源:CaldroidGridAdapter.java
示例10: retrieveInitialArgs
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
/**
* Retrieve initial arguments to the fragment Data can include: month, year,
* dialogTitle, showNavigationArrows,(String) disableDates, selectedDates,
* minDate, maxDate
*/
protected void retrieveInitialArgs(Bundle savedInstanceState) {
// Get arguments
Bundle args = getArguments();
if (args != null) {
// Get month, year
month = args.getInt(MONTH, -1);
year = args.getInt(YEAR, -1);
dialogTitle = args.getString(DIALOG_TITLE);
Dialog dialog = getDialog();
if (dialog != null) {
if (dialogTitle != null) {
dialog.setTitle(dialogTitle);
} else {
// Don't display title bar if user did not supply
// dialogTitle
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
}
}
// Get start day of Week. Default calendar first column is SUNDAY
startDayOfWeek = args.getInt(START_DAY_OF_WEEK, 1);
if (startDayOfWeek > 7) {
startDayOfWeek = startDayOfWeek % 7;
}
// Should show arrow
showNavigationArrows = args
.getBoolean(SHOW_NAVIGATION_ARROWS, true);
// Should enable swipe to change month
enableSwipe = args.getBoolean(ENABLE_SWIPE, true);
// Get sixWeeksInCalendar
sixWeeksInCalendar = args.getBoolean(SIX_WEEKS_IN_CALENDAR, true);
// Get clickable setting
enableClickOnDisabledDates = args.getBoolean(ENABLE_CLICK_ON_DISABLED_DATES, false);
// Get selected dates
ArrayList<String> selectedDateStrings = args.getStringArrayList(SELECTED_DATES);
if (selectedDateStrings != null && selectedDateStrings.size() > 0) {
for (String dateString : selectedDateStrings) {
DateTime dt = CalendarHelper.getDateTimeFromString(dateString, "yyyy-MM-dd");
selectedDates.add(dt);
}
}
// Get min date and max date
String minDateTimeString = args.getString(MIN_DATE);
if (minDateTimeString != null) {
minDateTime = CalendarHelper.getDateTimeFromString(
minDateTimeString, null);
}
String maxDateTimeString = args.getString(MAX_DATE);
if (maxDateTimeString != null) {
maxDateTime = CalendarHelper.getDateTimeFromString(
maxDateTimeString, null);
}
}
if (month == -1 || year == -1) {
DateTime dateTime = DateTime.today(TimeZone.getDefault());
month = dateTime.getMonth();
year = dateTime.getYear();
}
}
示例11: setAdapterDateTime
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public void setAdapterDateTime(DateTime dateTime) {
this.month = dateTime.getMonth();
this.year = dateTime.getYear();
this.datetimeList = CalendarHelper.getFullWeeks(this.month, this.year,
startDayOfWeek, sixWeeksInCalendar);
}
示例12: setAdapterDateTime
import hirondelle.date4j.DateTime; //导入方法依赖的package包/类
public void setAdapterDateTime(DateTime dateTime) {
this.month = dateTime.getMonth();
this.year = dateTime.getYear();
this.datetimeList = CalendarHelper.getFullWeeks(this.month, this.year,
startDayOfWeek);
}