Skip to content

Date picker component which allows to select the current month, using the drop-down lists to set the month and year. In addition to this, it supports a fixed date range.

License

Notifications You must be signed in to change notification settings

eqlbin/gwt-dropdown-month-datepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

http://eqlbin.github.io/gwt-dropdown-month-datepicker/demo/

Screenshot

Screenshot

Building

git clone https://github.com/eqlbin/gwt-dropdown-month-datepicker.git
cd gwt-dropdown-month-datepicker
mvn package
  • JAR with DatePicker widget

    gwt-dropdown-month-datepicker/datepicker/target/dropdown-month-datepicker-1.0-SNAPSHOT.jar

  • WAR with demo

    gwt-dropdown-month-datepicker/example/target/dropdown-month-datepicker-example-1.0-SNAPSHOT.war

Usage

  1. Put the JAR with the DropdownMonthDatePicker widget into your classpath

    For example, WEB-INF/lib

  2. Inherit the DropdownMonthDatePicker module into your *.gwt.xml

    <inherits name='ru.eqlbin.gwt.datepicker.DropdownMonthDatePicker'/>
  3. Write the code

    // Floating date range
    int yearsCount = 10;
    DropdownMonthDatePicker datePickerFloating = new DropdownMonthDatePicker();
    datePickerFloating.setVisibleYearCount(yearsCount);
    
    // Fixed date range
    DropdownMonthDatePicker datePickerFixed = new DropdownMonthDatePicker();
    Date minDate = new Date(2010-1900, 0, 1);
    Date maxDate = new Date(2029-1900, 11, 31);
    datePickerFixed.setDateRange(minDate, maxDate);
    // yearsCount can also be used with a fixed date range
    datePickerFixed.setVisibleYearCount(yearsCount);

Note

This project was created in times of GWT 2.5.

Similar functionality appeared in default DatePicker since version 2.6:

DatePicker datePicker = new DatePicker();
datePicker.setYearAndMonthDropdownVisible(true);
datePicker.setYearArrowsVisible(true);

So, now this project is just an example of how to create your own MonthSelector and how to implement a fixed date range.

About

Date picker component which allows to select the current month, using the drop-down lists to set the month and year. In addition to this, it supports a fixed date range.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published