Package com.cedarsolutions.client.gwt.custom.datepicker

Examples of com.cedarsolutions.client.gwt.custom.datepicker.DateBox


    /** Test getDateCriteria(). */
    public void testGetDateCriteria() {
        Date date = GwtDateUtils.createDate(2011, 11, 15, 19, 32, 19, 224);
        Date expected = GwtDateUtils.createDate(2011, 11, 15, 19, 18, 22, 1);

        DateBox input = new DateBox();
        input.setValue(date);

        assertEquals(expected, ViewDataUtils.getDateCriteria(input, "19:18:22,001"));
    }
View Full Code Here


    /** Test getStartDateCriteria(). */
    public void testGetStartDateCriteria() {
        Date date = GwtDateUtils.createDate(2011, 11, 15, 19, 32, 19, 224);
        Date expected = GwtDateUtils.createDate(2011, 11, 15, 0, 0, 0, 0);

        DateBox input = new DateBox();
        input.setValue(date);

        assertEquals(expected, ViewDataUtils.getStartDateCriteria(input));
    }
View Full Code Here

    /** Test getEndDateCriteria(). */
    public void testGetEndDateCriteria() {
        Date date = GwtDateUtils.createDate(2011, 11, 15, 19, 32, 19, 224);
        Date expected = GwtDateUtils.createDate(2011, 11, 15, 23, 59, 59, 999);

        DateBox input = new DateBox();
        input.setValue(date);

        assertEquals(expected, ViewDataUtils.getEndDateCriteria(input));
    }
View Full Code Here

public class ViewDataUtilsClientTest extends ClientTestCase {

    /** Test createDateBoxForDate(). */
    public void testCreateDateBoxForDate() {
        Date date = createDate(2013, 1, 2, 3, 4, 5, 6);
        DateBox dateBox = ViewDataUtils.createDateBoxForDate();
        assertNotNull(dateBox);
        assertEquals(formatDate(date), dateBox.getFormat().format(dateBox, date));
    }
View Full Code Here

    }

    /** Test createDateBoxForTime(). */
    public void testCreateDateBoxForTime() {
        Date date = createDate(2013, 1, 2, 3, 4, 5, 6);
        DateBox dateBox = ViewDataUtils.createDateBoxForTime();
        assertNotNull(dateBox);
        assertEquals(formatTime(date), dateBox.getFormat().format(dateBox, date));
    }
View Full Code Here

    }

    /** Test createDateBoxForTimestamp(). */
    public void testCreateDateBoxForTimestamp() {
        Date date = createDate(2013, 1, 2, 3, 4, 5, 6);
        DateBox dateBox = ViewDataUtils.createDateBoxForTimestamp();
        assertNotNull(dateBox);
        assertEquals(formatTimestamp(date), dateBox.getFormat().format(dateBox, date));
    }
View Full Code Here

    /** Test getCriteriaList() for DateBox. */
    public void testGetCriteriaListDateBox() {
        Date date = GwtDateUtils.createDate(2011, 11, 15, 19, 32, 19, 224);

        DateBox input = new DateBox();
        input.setValue(date);

        List<Date> expected = new ArrayList<Date>();
        expected.add(date);
        assertEquals(expected, ViewDataUtils.getCriteriaList(input));
    }
View Full Code Here

    /** Test getCriteria() for DateBox. */
    public void testGetCriteriaDateBox() {
        Date date = GwtDateUtils.createDate(2011, 11, 15, 19, 32, 19, 224);

        DateBox input = new DateBox();
        input.setValue(date);

        assertEquals(date, ViewDataUtils.getCriteria(input));
    }
View Full Code Here

    /** The timestamp used for creating end dates. */
    public static final String END_TIMESTAMP = "23:59:59,999";

    /** Create a DateBox using the standard GwtDateUtils date format. */
    public static DateBox createDateBoxForDate() {
        DateBox dateBox = new DateBox();
        dateBox.setFormat(new DateBox.DefaultFormat(GwtDateUtils.getDateFormat()));
        return dateBox;
    }
View Full Code Here

        return dateBox;
    }

    /** Create a DateBox using the standard GwtDateUtils time format. */
    public static DateBox createDateBoxForTime() {
        DateBox dateBox = new DateBox();
        dateBox.setFormat(new DateBox.DefaultFormat(GwtDateUtils.getTimeFormat()));
        return dateBox;
    }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.client.gwt.custom.datepicker.DateBox

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.