Package org.joda.time

Examples of org.joda.time.DateMidnight.toDate()


  @Test
  public void canConvertDate_toGregorianCalendar() {
    LocalDate lt = new LocalDate(2000, 1, 2);
    DateMidnight dm = lt.toDateMidnight(DateTimeZone.UTC);
   
    XMLGregorianCalendar gc = XmlUtils.asXMLGregorianCalendar(dm.toDate());
    Assert.assertEquals("2000-01-02T00:00:00.000Z", gc.toXMLFormat());
  }
 
  @Test
  public void canConvert_GregorianCalendar_toDate() {
View Full Code Here


  @Test
  public void canConvert_GregorianCalendar_toDate() {
    LocalDate lt = new LocalDate(2000, 1, 2);
    DateMidnight dm = lt.toDateMidnight(DateTimeZone.UTC);
   
    Date d = dm.toDate();
   
    XMLGregorianCalendar gc = XmlUtils.asXMLGregorianCalendar(d);
    Date dConv = XmlUtils.asDate(gc);
   
    Assert.assertEquals(d, dConv);
View Full Code Here

    }
   
    @Test
    public void testMidnight() {
        DateMidnight dateMidnight = new DateMidnight(date);
        assertTrue(dateMidnight.toDate().before(date));
    }
   
    @Test
    public void testEqualDate() {
        when(filterCriterion.getOperator()).thenReturn(CriterionOperator.EQ);
View Full Code Here

    List<Patient> patientList = patientDAO.loadAll();
    Map<Date, Integer> freqMap = new Hashtable<Date, Integer>();
    for (Patient patient : patientList) {
      if (patient.valid()){
        DateMidnight dm = new DateMidnight(patient.getVisitDate());
        int i = (freqMap.get(dm.toDate()) == null? 0: freqMap.get(dm.toDate()));
        freqMap.put(dm.toDate(), ++i);     
      }
    }
    Set<Date> keys = freqMap.keySet();
    for (Date date : keys) {
View Full Code Here

    List<Patient> patientList = patientDAO.loadAll();
    Map<Date, Integer> freqMap = new Hashtable<Date, Integer>();
    for (Patient patient : patientList) {
      if (patient.valid()){
        DateMidnight dm = new DateMidnight(patient.getVisitDate());
        int i = (freqMap.get(dm.toDate()) == null? 0: freqMap.get(dm.toDate()));
        freqMap.put(dm.toDate(), ++i);     
      }
    }
    Set<Date> keys = freqMap.keySet();
    for (Date date : keys) {
View Full Code Here

    Map<Date, Integer> freqMap = new Hashtable<Date, Integer>();
    for (Patient patient : patientList) {
      if (patient.valid()){
        DateMidnight dm = new DateMidnight(patient.getVisitDate());
        int i = (freqMap.get(dm.toDate()) == null? 0: freqMap.get(dm.toDate()));
        freqMap.put(dm.toDate(), ++i);     
      }
    }
    Set<Date> keys = freqMap.keySet();
    for (Date date : keys) {
      VisitFrequency v = new VisitFrequency();
View Full Code Here

    do {
      if (++paranoiaCounter > 4000) {
        log.error("Paranoia counter exceeded! Dear developer, please have a look at the implementation of buildEvents.");
        break;
      }
      final DayHolder dh = new DayHolder(day.toDate());
      String backgroundColor, color, textColor;
      if (dh.isHoliday() == true) {
        if (dh.isWorkingDay() == true) {
          backgroundColor = "#FFF0F0";
          color = "#EEEEEE";
View Full Code Here

     */
    public static Date getNextDayMidnightDate(){
        DateTime midNight = new DateTime();
        midNight = midNight.plusDays(1);
        final DateMidnight midnightDate  = midNight.toDateMidnight();
        return midnightDate.toDate();
    }

    /**
     * Retrieve before day midnight.
     * @return
 
View Full Code Here

     */
    public static Date getBeforeDayMidnightDate(){
        DateTime midNight = new DateTime();
        midNight = midNight.plusDays(-1);
        final DateMidnight midnightDate  = midNight.toDateMidnight();
        return midnightDate.toDate();
    }

    /**
     * Increase a day your date.
     * @param startDate
View Full Code Here

        // add some buy transactions
        DateMidnight date = startDate;
        while (date.isBefore(endDate))
        {
            long p = security.getSecurityPrice(date.toDate()).getValue();
            portfolio.inbound_delivery(security, date, 1 * Values.Share.factor(), p);
            date = date.plusDays(20);
        }

        portfolio.addTo(client);
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.