Package net.sf.mpxj

Examples of net.sf.mpxj.DateRange


               int startOffset = offset + 8 + (periodIndex * 2);
               start = MPPUtility.getTime(data, startOffset);
               int durationOffset = offset + 20 + (periodIndex * 4);
               duration = MPPUtility.getDuration(data, durationOffset);
               Date end = new Date(start.getTime() + duration);
               dateRanges.add(new DateRange(start, end));
               ++periodIndex;
            }

            if (dateRanges.isEmpty())
            {
View Full Code Here


               {
                  for (int exceptionPeriodIndex = 0; exceptionPeriodIndex < periodCount; exceptionPeriodIndex++)
                  {
                     start = MPPUtility.getTime(data, offset + 20 + (exceptionPeriodIndex * 2));
                     duration = MPPUtility.getDuration(data, offset + 32 + (exceptionPeriodIndex * 4));
                     exception.addRange(new DateRange(start, new Date(start.getTime() + duration)));
                  }
               }

               //
               // Extract the name length - ensure that it is aligned to a 4 byte boundary
View Full Code Here

                  cal.setTime(endTime);
                  cal.add(Calendar.DAY_OF_YEAR, 1);
                  endTime = cal.getTime();
               }

               hours.addRange(new DateRange(startTime, endTime));
            }
         }
      }
   }
View Full Code Here

                  cal.setTime(endTime);
                  cal.add(Calendar.DAY_OF_YEAR, 1);
                  endTime = cal.getTime();
               }

               exception.addRange(new DateRange(startTime, endTime));
            }
         }
      }
   }
View Full Code Here

                        cal.setTime(endTime);
                        cal.add(Calendar.DAY_OF_YEAR, 1);
                        endTime = cal.getTime();
                     }

                     bce.addRange(new DateRange(startTime, endTime));
                  }
               }
            }
         }
      }
View Full Code Here

         {
            ProjectCalendarWeek week = mpxjCalendar.addWorkWeek();
            week.setName(xmlWeek.getName());
            Date startTime = DatatypeConverter.parseDate(xmlWeek.getTimePeriod().getFromDate());
            Date endTime = DatatypeConverter.parseDate(xmlWeek.getTimePeriod().getToDate());
            week.setDateRange(new DateRange(startTime, endTime));

            WeekDays xmlWeekDays = xmlWeek.getWeekDays();
            if (xmlWeekDays != null)
            {
               for (WeekDay xmlWeekDay : xmlWeekDays.getWeekDay())
               {
                  int dayNumber = xmlWeekDay.getDayType().intValue();
                  Day day = Day.getInstance(dayNumber);
                  week.setWorkingDay(day, BooleanUtility.getBoolean(xmlWeekDay.isDayWorking()));
                  ProjectCalendarHours hours = week.addCalendarHours(day);

                  Project.Calendars.Calendar.WorkWeeks.WorkWeek.WeekDays.WeekDay.WorkingTimes times = xmlWeekDay.getWorkingTimes();
                  if (times != null)
                  {
                     for (Project.Calendars.Calendar.WorkWeeks.WorkWeek.WeekDays.WeekDay.WorkingTimes.WorkingTime period : times.getWorkingTime())
                     {
                        startTime = DatatypeConverter.parseTime(period.getFromTime());
                        endTime = DatatypeConverter.parseTime(period.getToTime());

                        if (startTime != null && endTime != null)
                        {
                           if (startTime.getTime() >= endTime.getTime())
                           {
                              Calendar cal = Calendar.getInstance();
                              cal.setTime(endTime);
                              cal.add(Calendar.DAY_OF_YEAR, 1);
                              endTime = cal.getTime();
                           }

                           hours.addRange(new DateRange(startTime, endTime));
                        }
                     }
                  }
               }
            }
View Full Code Here

               int startOffset = offset + 8 + (periodIndex * 2);
               start = MPPUtility.getTime(data, startOffset);
               int durationOffset = offset + 20 + (periodIndex * 4);
               duration = MPPUtility.getDuration(data, durationOffset);
               Date end = new Date(start.getTime() + duration);
               dateRanges.add(new DateRange(start, end));
               ++periodIndex;
            }

            if (dateRanges.isEmpty())
            {
View Full Code Here

               {
                  for (int exceptionPeriodIndex = 0; exceptionPeriodIndex < periodCount; exceptionPeriodIndex++)
                  {
                     start = MPPUtility.getTime(data, offset + 20 + (exceptionPeriodIndex * 2));
                     duration = MPPUtility.getDuration(data, offset + 32 + (exceptionPeriodIndex * 4));
                     exception.addRange(new DateRange(start, new Date(start.getTime() + duration)));
                  }
               }

               //
               // Extract the name length - ensure that it is aligned to a 4 byte boundary
View Full Code Here

      List<AvailabilityPeriod> list = periods.getAvailabilityPeriod();
      for (Availability availability : mpx.getAvailability())
      {
         AvailabilityPeriod period = m_factory.createProjectResourcesResourceAvailabilityPeriodsAvailabilityPeriod();
         list.add(period);
         DateRange range = availability.getRange();

         period.setAvailableFrom(DatatypeConverter.printDate(range.getStart()));
         period.setAvailableTo(DatatypeConverter.printDate(range.getEnd()));
         period.setAvailableUnits(DatatypeConverter.printUnits(availability.getUnits()));
      }
   }
View Full Code Here

      return;
    WorkingHours workingHours=day.getWorkingHours();

    for (WorkRange range:(List<WorkRange>)workingHours.getIntervals()) { //claur
      if (range!=null)
        mpxDay.addRange(new DateRange(DateTime.fromGmt(range.getNormalizedStartTime()),DateTime.fromGmt(range.getNormalizedEndTime())));
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.mpxj.DateRange

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.