Java Code Examples for org.joda.time.LocalDate.getYear()

The following are Jave code examples for showing how to use getYear() of the org.joda.time.LocalDate class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Auto.js   File: TimedTaskSettingActivity.java   Source Code and License Vote up 6 votes
private TimedTask createDisposableTask() {
    LocalTime time = TIME_FORMATTER.parseLocalTime(mDisposableTaskTime.getText().toString());
    LocalDate date = DATE_FORMATTER.parseLocalDate(mDisposableTaskDate.getText().toString());
    LocalDateTime dateTime = new LocalDateTime(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth(),
            time.getHourOfDay(), time.getMinuteOfHour());
    if (dateTime.isBefore(LocalDateTime.now())) {
        Toast.makeText(this, R.string.text_disposable_task_time_before_now, Toast.LENGTH_SHORT).show();
        return null;
    }
    return TimedTask.disposableTask(dateTime, mScriptFile.getPath(), ExecutionConfig.getDefault());
}
 
Example 2
Project: CalendarFX   File: LocalDateIteratorFactory.java   Source Code and License Vote up 5 votes
static DateValue localDateToDateValue(LocalDate date) {
    return new DateValueImpl(
            date.getYear(), date.getMonthOfYear(), date.getDayOfMonth());
}
 
Example 3
Project: MovieApp   File: Utils.java   Source Code and License Vote up 4 votes
public static int getReleaseYear(String date) {
    DateTimeFormatter formatter = forPattern("yyyy-MM-dd").withLocale(Locale.US);
    LocalDate date1 = formatter.parseLocalDate(date);
    return date1.getYear();
}
 
Example 4
Project: MovieApp   File: Utils.java   Source Code and License Vote up 4 votes
public static int getReleaseYear(String date) {
    DateTimeFormatter formatter = forPattern("yyyy-MM-dd").withLocale(Locale.US);
    LocalDate date1 = formatter.parseLocalDate(date);
    return date1.getYear();
}