Examples of DateHolder


Examples of org.projectforge.common.DateHolder

   */
  @Transient
  public TimesheetDO setStopDate(final Date stopDate)
  {
    if (stopDate != null) {
      final DateHolder date = new DateHolder(stopDate, DatePrecision.MINUTE_15);
      this.stopTime = date.getTimestamp();
    } else {
      this.stopTime = null;
    }
    return this;
  }
View Full Code Here

Examples of org.projectforge.common.DateHolder

            modifiedStartDatePanel.markModelAsChanged();
            modifiedStopDatePanel.markModelAsChanged();
            filter.setLastDays(null);
            return;
          }
          final DateHolder dh = new DateHolder(new Date(), DatePrecision.MILLISECOND);
          dh.setEndOfDay();
          filter.setStopTimeOfModification(dh.getDate());
          dh.setBeginOfDay();
          dh.add(Calendar.DAY_OF_YEAR, -newSelection);
          filter.setStartTimeOfModification(dh.getDate());
          filter.setLastDays(null);
          modifiedStartDatePanel.markModelAsChanged();
          modifiedStopDatePanel.markModelAsChanged();
        }
View Full Code Here

Examples of org.projectforge.common.DateHolder

  @Override
  public HRPlanningListFilter reset()
  {
    super.reset();
    setUserId(PFUserContext.getUserId());
    final DateHolder date = new DateHolder(DatePrecision.DAY);
    date.setBeginOfWeek();
    setStartTime(date.getTimestamp());
    date.setEndOfWeek();
    setStopTime(date.getTimestamp());
    return this;
  }
View Full Code Here

Examples of org.projectforge.common.DateHolder

  @Override
  public void select(final String property, final Object selectedValue)
  {
    if (property.equals("week") == true) {
      final Date date = (Date) selectedValue;
      final DateHolder dateHolder = new DateHolder(date);
      form.getSearchFilter().setStartTime(dateHolder.getDate());
      dateHolder.setEndOfWeek();
      form.getSearchFilter().setStopTime(dateHolder.getDate());
      form.startDate.markModelAsChanged();
      form.stopDate.markModelAsChanged();
      refresh();
    } else {
      log.error("Property '" + property + "' not supported for selection.");
View Full Code Here

Examples of org.projectforge.common.DateHolder

      if (element == null) {
        // Empty row:
        continue;
      }
      final BuchungssatzDO satz = element.getValue();
      final DateHolder date = new DateHolder(satz.getDatum(), DatePrecision.DAY, Locale.GERMAN);
      if (year == 0) {
        year = date.getYear();
      } else if (year != date.getYear()) {
        final String msg = "Not supported: Buchungssätze innerhalb eines Excel-Sheets liegen in verschiedenen Jahren: Im Blatt '" + sheet.getSheetName() + "', in Zeile " + (i + 2);
        actionLog.logError(msg);
        throw new UserException(msg);
      }
      if (date.getMonth() > month) {
        final String msg = "Buchungssätze können nicht in die Zukunft für den aktuellen Monat '"
            + KostFormatter.formatBuchungsmonat(year, date.getMonth())
            + " gebucht werden! "
            + satz;
        actionLog.logError(msg);
        throw new RuntimeException(msg);
      } else if (date.getMonth() < month) {
        final String msg = "Buchungssatz liegt vor Monat '" + KostFormatter.formatBuchungsmonat(year, month) + "' (OK): " + satz;
        actionLog.logInfo(msg);
      }
      satz.setYear(year);
      satz.setMonth(month);
View Full Code Here

Examples of org.projectforge.common.DateHolder

      myFilter = (TimesheetFilter) filter;
    } else {
      myFilter = new TimesheetFilter(filter);
    }
    if (myFilter.getStopTime() != null) {
      final DateHolder date = new DateHolder(myFilter.getStopTime());
      date.setEndOfDay();
      myFilter.setStopTime(date.getDate());
    }
    final QueryFilter queryFilter = buildQueryFilter(myFilter);
    List<TimesheetDO> result = getList(queryFilter);
    if (result == null) {
      return null;
View Full Code Here

Examples of org.projectforge.common.DateHolder

    for (final TaskNode node : list) {
      final Date date = node.getTask().getProtectTimesheetsUntil();
      if (date == null) {
        continue;
      }
      final DateHolder dh = new DateHolder(date);
      dh.setEndOfDay();
      if (timesheet.getStartTime().before(dh.getDate()) == true) {
        if (throwException == true) {
          throw new AccessException("timesheet.error.timesheetProtectionVioloation", node.getTask().getTitle()
              + " (#"
              + node.getTaskId()
              + ")", DateHelper.formatIsoDate(dh.getDate()));
        }
        return false;
      }
    }
    return true;
View Full Code Here

Examples of org.projectforge.common.DateHolder

    final String s = "select distinct location from "
        + clazz.getSimpleName()
        + " t where deleted=false and t.user.id = ? and lastUpdate > ? and lower(t.location) like ?) order by t.location";
    final Query query = getSession().createQuery(s);
    query.setInteger(0, PFUserContext.getUser().getId());
    final DateHolder dh = new DateHolder();
    dh.add(Calendar.YEAR, -1);
    query.setDate(1, dh.getDate());
    query.setString(2, "%" + StringUtils.lowerCase(searchString) + "%");
    final List<String> list = query.list();
    return list;
  }
View Full Code Here

Examples of org.projectforge.common.DateHolder

    log.info("Get recent locations from the database.");
    final String s = "select location from "
        + (clazz.getSimpleName() + " t where deleted=false and t.user.id = ? and lastUpdate > ? and t.location != null and t.location != '' order by t.lastUpdate desc");
    final Query query = getSession().createQuery(s);
    query.setInteger(0, PFUserContext.getUser().getId());
    final DateHolder dh = new DateHolder();
    dh.add(Calendar.YEAR, -1);
    query.setDate(1, dh.getDate());
    final List<Object> list = query.list();
    int counter = 0;
    final List<String> res = new ArrayList<String>();
    for (final Object loc : list) {
      if (res.contains(loc) == true) {
View Full Code Here

Examples of org.projectforge.common.DateHolder

    }
    if (week != null) {
      getData().setWeek(week);
    }
    if (getData().getWeek() != null) {
      final DateHolder date = new DateHolder(getData().getWeek(), ConfigXml.getInstance().getDefaultLocale());
      if (date.isBeginOfWeek() == false) {
        date.setBeginOfWeek();
        getData().setWeek(date.getSQLDate());
      }
    } else {
      // Get week of last edited entry as default.
      final Object obj = getUserPrefEntry(SESSION_KEY_RECENT_WEEK);
      if (obj instanceof Long) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.