当前位置: 首页>>代码示例>>Java>>正文


Java LocalTime.getMinuteOfHour方法代码示例

本文整理汇总了Java中org.joda.time.LocalTime.getMinuteOfHour方法的典型用法代码示例。如果您正苦于以下问题:Java LocalTime.getMinuteOfHour方法的具体用法?Java LocalTime.getMinuteOfHour怎么用?Java LocalTime.getMinuteOfHour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.joda.time.LocalTime的用法示例。


在下文中一共展示了LocalTime.getMinuteOfHour方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDisposableTask

import org.joda.time.LocalTime; //导入方法依赖的package包/类
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());
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:12,代码来源:TimedTaskSettingActivity.java

示例2: addDateAndTime

import org.joda.time.LocalTime; //导入方法依赖的package包/类
public static DateTime addDateAndTime(LocalDate date, LocalTime time)
{
    return new DateTime(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth(),
            time.getHourOfDay(), time.getMinuteOfHour(), time.getSecondOfMinute(), DATE_TZ);
}
 
开发者ID:jseparovic,项目名称:MQL4Java,代码行数:6,代码来源:DateUtil.java

示例3: changeNotificationPreferences

import org.joda.time.LocalTime; //导入方法依赖的package包/类
private void changeNotificationPreferences(int departureMinutes, int arrivalMinutes) {
  Boolean haveNotifications = false;
  Boolean hadNotifications = false;
  Bundle bundle = new Bundle();
  bundle.putString(BundleKeys.TRIP, tripId);
  bundle.putString(BundleKeys.TRIP_NAME, possibleTrip.getTripShortName());
  bundle.putString(BundleKeys.STOP_SOURCE, sourceId);
  bundle.putString(BundleKeys.STOP_DESTINATION, destinationId);
  bundle.putString(BundleKeys.STOP_SOURCE_NAME, possibleTrip.getFirstStopName());
  bundle.putLong(BundleKeys.STOP_SOURCE_TIME, possibleTrip.getDepartureTime().toDateTimeToday().getMillis());
  bundle.putString(BundleKeys.STOP_DESTINATION_NAME, possibleTrip.getLastStopName());
  bundle.putLong(BundleKeys.STOP_DESTINATION_TIME, possibleTrip.getArrivalTime().toDateTimeToday().getMillis());

  hadNotifications = notifications.getAlarmId(tripId, Notifications.ARRIVING) != -1 || notifications.getAlarmId(tripId, Notifications.DEPARTING) != -1;
  notifications.cancel(tripId, Notifications.ARRIVING);
  notifications.cancel(tripId, Notifications.DEPARTING);
  chooChooFab.setBackgroundTintList(ColorStateList.valueOf(ColorUtils.getThemeColor(this, R.attr.colorAccent)));

  if (arrivalMinutes > 0) {
    LocalTime arrivalTime = possibleTrip.getArrivalTime();
    LocalDateTime arrivingDateTime = new LocalDateTime(stopDateTime.getYear(), stopDateTime.getMonthOfYear(), stopDateTime.getDayOfMonth(), arrivalTime.getHourOfDay(), arrivalTime.getMinuteOfHour());

    bundle.putString(BundleKeys.STOP_METHOD, Notifications.ARRIVING);
    notifications.set(tripId, arrivingDateTime, arrivalMinutes, Notifications.ARRIVING, bundle);
    chooChooFab.setBackgroundTintList(ColorStateList.valueOf(ColorUtils.getThemeColor(this, R.attr.colorPrimary)));
    haveNotifications = true;
  }

  if (departureMinutes > 0) {
    LocalTime departingTime = possibleTrip.getDepartureTime();
    LocalDateTime departingDateTime = new LocalDateTime(stopDateTime.getYear(), stopDateTime.getMonthOfYear(), stopDateTime.getDayOfMonth(), departingTime.getHourOfDay(), departingTime.getMinuteOfHour());

    bundle.putString(BundleKeys.STOP_METHOD, Notifications.DEPARTING);
    notifications.set(tripId, departingDateTime, departureMinutes, Notifications.DEPARTING, bundle);
    chooChooFab.setBackgroundTintList(ColorStateList.valueOf(ColorUtils.getThemeColor(this, R.attr.colorPrimary)));
    haveNotifications = true;
  }

  if (haveNotifications) {
    Toast.makeText(this, getString(R.string.notifications_saved), Toast.LENGTH_SHORT).show();
  } else if (hadNotifications) {
    Toast.makeText(this, getString(R.string.notifications_removed), Toast.LENGTH_SHORT).show();
  }
}
 
开发者ID:eleith,项目名称:calchoochoo,代码行数:45,代码来源:TripActivity.java


注:本文中的org.joda.time.LocalTime.getMinuteOfHour方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。