Package org.projectforge.common

Examples of org.projectforge.common.DateHolder


  @Override
  public TimesheetListFilter 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


  private PFUserDO user;

  public void reset()
  {
    if (year <= 0 || month < 0) {
      DateHolder date = new DateHolder();
      year = date.getYear();
      month = date.getMonth();
    }
    if (user == null) {
      user = PFUserContext.getUser();
    }
  }
View Full Code Here

  DateHolder dateHolder;

  public DateInputField()
  {
    dateHolder = new DateHolder();
  }
View Full Code Here

      mapping.add(Col.TASK_TITLE, node.getTask().getTitle());
      mapping.add(Col.TASK_PATH, taskFormatter.getTaskPath(timesheet.getTaskId(), null, true, OutputType.PLAIN));
      mapping.add(Col.WEEK_OF_YEAR, timesheet.getFormattedWeekOfYear());
      mapping.add(Col.DAY_OF_WEEK, dateTimeFormatter.getFormattedDate(timesheet.getStartTime(), DateFormats
          .getFormatString(DateFormatType.DAY_OF_WEEK_SHORT)));
      final DateHolder startTime = new DateHolder(timesheet.getStartTime());
      final DateHolder stopTime = new DateHolder(timesheet.getStopTime());
      mapping.add(Col.START_TIME, startTime);
      mapping.add(Col.STOP_TIME, stopTime);
      final BigDecimal seconds = new BigDecimal(timesheet.getDuration() / 1000); // Seconds
      final BigDecimal duration = seconds.divide(new BigDecimal(60 * 60 * 24), 8, RoundingMode.HALF_UP); // Fraction of day (24 hours)
      mapping.add(Col.DURATION, duration.doubleValue());
View Full Code Here

    dateHolder = new DateHolder();
  }

  public DateInputField(DatePrecision precision)
  {
    dateHolder = new DateHolder(precision);
  }
View Full Code Here

    dateHolder = new DateHolder(precision);
  }

  public DateInputField(Date date, DatePrecision precision)
  {
    dateHolder = new DateHolder(date, precision);
  }
View Full Code Here

  {
    if (this.datum == null || this.faelligkeit == null) {
      this.zahlungsZielInTagen = null;
      return;
    }
    final DateHolder date = new DateHolder(this.datum);
    this.zahlungsZielInTagen = date.daysBetween(this.faelligkeit);
  }
View Full Code Here

  {
    if (startTimeOfLastModification == null) {
      super.setStartTimeOfModification(null);
      return this;
    }
    final DateHolder dh = new DateHolder(startTimeOfLastModification, DatePrecision.MILLISECOND);
    dh.setBeginOfDay();
    super.setStartTimeOfModification(dh.getDate());
    return this;
  }
View Full Code Here

  {
    if (stopTimeOfLastModification == null) {
      super.setStopTimeOfModification(null);
      return this;
    }
    final DateHolder dh = new DateHolder(stopTimeOfLastModification, DatePrecision.MILLISECOND);
    dh.setEndOfDay();
    super.setStopTimeOfModification(dh.getDate());
    return this;
  }
View Full Code Here

      public void validate(final Form< ? > form)
      {
        final DateTimePanel startDateTimePanel = (DateTimePanel) dependentFormComponentsWithCost2[0];
        final DropDownChoice<Integer> stopHourOfDayDropDownChoice = (DropDownChoice<Integer>) dependentFormComponentsWithCost2[1];
        final DropDownChoice<Integer> stopMinuteDropDownChoice = (DropDownChoice<Integer>) dependentFormComponentsWithCost2[2];
        final DateHolder startDate = new DateHolder(startDateTimePanel.getConvertedInput());
        final DateHolder stopDate = new DateHolder(startDate.getTimestamp());
        stopDate.setHourOfDay(stopHourOfDayDropDownChoice.getConvertedInput());
        stopDate.setMinute(stopMinuteDropDownChoice.getConvertedInput());
        if (stopDate.getTimeOfDay() < startDate.getTimeOfDay()) { // Stop time is
          // before start time. Assuming next day for stop time:
          stopDate.add(Calendar.DAY_OF_MONTH, 1);
        }
        data.setStartTime(startDate.getTimestamp());
        data.setStopTime(stopDate.getTimestamp());
        if (data.getDuration() < 60000) {
          // Duration is less than 60 seconds.
          stopMinuteDropDownChoice.error(getString("timesheet.error.zeroDuration"));
        } else if (data.getDuration() > TimesheetDao.MAXIMUM_DURATION) {
          stopMinuteDropDownChoice.error(getString("timesheet.error.maximumDurationExceeded"));
View Full Code Here

TOP

Related Classes of org.projectforge.common.DateHolder

Copyright © 2018 www.massapicom. 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.