dt = dt.withDayOfYear(1).withMillisOfDay(0); break; case MONTHS: dt = dt.withDayOfMonth(1).withMillisOfDay(0); break; case WEEKS: dt = dt.withDayOfWeek(1).withMillisOfDay(0); break; case DAYS:
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime yet: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
@Override public long resolveSegmentKey(long activeTime) { return new DateTime(activeTime).withMillisOfDay(0).getMillis(); } }
@Override public PathFinder apply(Entry<Integer, Path> input) { return new PathFinder(timestamp.withMillisOfDay((int)TimeUnit.MILLISECONDS.convert(input.getKey(), TimeUnit.MINUTES)), basePath); } @Override
public JpaBatchJobExecutionStatusCounts(String status, String feedName, Integer year, Integer month, Integer day, Long count) { this.status = status; this.count = count; this.feedName = feedName; this.date = new DateTime().withDate(year, month, day).withMillisOfDay(0); }
@Override public Object convertExternalValue(Task task, AttributeInstance attributeInstance, AttributeDef attributeDef, String contextName, Object externalValue) { DateTime dt = (DateTime) super.convertExternalValue( task, attributeInstance, attributeDef, contextName, externalValue ); if ( dt != null ) dt = dt.withMillisOfDay( 0 ); return dt; }
/** * Returns the day of the activity. * Hours, minutes, seconds of the returned value are to be ignored. */ public DateTime getDay() { return getStart().withMillisOfDay(0); }
private DateTime getCurrentDate() { DateTime now = DateTime.now(); DateTime firstShiftStart = DateTime.now().withMillisOfDay(21600000); DateTimeComparator timeComparator = DateTimeComparator.getTimeOnlyInstance(); if (timeComparator.compare(firstShiftStart, now) > 0) { return firstShiftStart.minusDays(1); } return firstShiftStart; } }
public static DateTime getDateTime(final double date, final boolean use1904windowing) { final Calendar c = ExcelDateUtil.getJavaCalendar(date, use1904windowing); if (c == null) { return null; } return new DateTime().withYear(c.get(Calendar.YEAR)).withMonthOfYear(c.get(Calendar.MONTH) + 1).withDayOfMonth(c.get(Calendar.DAY_OF_MONTH)) .withMillisOfDay(0); } }
public static DateTime getDateTime(final double date, final boolean use1904windowing) { final Calendar c = ExcelDateUtil.getJavaCalendar(date, use1904windowing); if (c == null) { return null; } return new DateTime().withYear(c.get(Calendar.YEAR)).withMonthOfYear(c.get(Calendar.MONTH) + 1).withDayOfMonth(c.get(Calendar.DAY_OF_MONTH)) .withMillisOfDay(0); } }
@SuppressLint("InflateParams") @TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(context); convertView = inflater.inflate(R.layout.grid_item, null); firstDay = getItem(0); } DateTime dateTime = getItem(position).withMillisOfDay(0); TextView dayTextView = (TextView) convertView.findViewById(R.id.daytext); dayTextView.setText(String.valueOf(dateTime.getDayOfMonth())); BusProvider.getInstance().post(new Event.OnDayDecorateEvent(convertView, dayTextView, dateTime, firstDay, WeekFragment.selectedDateTime)); return convertView; } }
/** * This method takes a string input and returns the formatted date. * @param inputDate is an input string like ${TODAY} or ${TODAY+1} * @return formatted date as String */ public long getLongDate(String inputDate) { long outputDate = 0L; outputDate = getDateTime(inputDate).withHourOfDay(0).withMillisOfDay(0).withMinuteOfHour(0).getMillis(); return outputDate; }
/** * Checks if this predicate holds for the given object. * @param object * the object to check * @return <code>true</code> if the given object is a project activity of * that day else <code>false</code> */ public boolean test(final ProjectActivity activity) { if (activity == null) { return false; } // Set hours, minutes, seconds and milliseconds of interval ends // to zero so that every activity of a day is contained within the // interval. final DateTime startAdjusted = timeInterval.getStart().withMillisOfDay(0); final DateTime endAdjusted = timeInterval.getEnd().withMillisOfDay(0); final Interval intervalAdjusted = new Interval(startAdjusted, endAdjusted); return intervalAdjusted.contains(activity.getStart().getMillis()); }
dvalue = ((DateTime) value).withMillisOfDay(0); } else if(value instanceof Date || value instanceof Calendar) { dvalue = new DateTime(value);
if (dateTime == null) dateTime = hours; else { dateTime = dateTime.withMillisOfDay(hours.getMillisOfDay()).withZone(hours.getZone());
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime yet: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
@Override protected Interval computeNext() { if(pending.toDuration().isEqual(Duration.ZERO)) { return endOfData(); } final Interval result; DateTime endOfDay = pending.getStart().withMillisOfDay(0).plusDays(1); if(endOfDay.isBefore(pending.getEnd())) { result = new Interval(pending.getStart(), endOfDay); pending = new Interval(endOfDay, pending.getEnd()); } else { result = pending; pending = new Interval(pending.getEnd(), pending.getEnd()); } return result; } }
/** Initializes the time interval for the span type of the filter. */ public void initTimeInterval() { DateTime now = DateUtils.getNowAsDateTime().withMillisOfDay(0); switch (spanType) { case Day: setTimeInterval(new Interval(now, now.plusDays(1))); break; case Week: now = now.withDayOfWeek(1); setTimeInterval(new Interval(now, now.plusWeeks(1))); break; case Month: now = now.withDayOfMonth(1); setTimeInterval(new Interval(now, now.plusMonths(1))); break; case Year: now = now.withDayOfYear(1); setTimeInterval(new Interval(now, now.plusYears(1))); break; } }