Re: [wicket-jquery-ui] How to modified RangeDatePickerTextField or DateRange Popup

12 views
Skip to first unread message

Sebastien

unread,
Aug 10, 2017, 11:53:05 AM8/10/17
to wicket-j...@googlegroups.com
Hi,

1/ number of calendars:
You need to pass the appropriate option to the RangeDatePicker:
https://github.com/foxrunsoftware/DatePicker/

Options options = new Options("calendar", 2);

new RangeDatePickerTextField("datepicker", model, options);


2/ Future dates.
Future dates are not disabled, you can actually select them :)
The fact is that there are of another color (grey) to visually understand this is in the future. The best would to override the css to change the color, I don't think there is an option for this...
http://foxrunsoftware.github.io/DatePicker/reference.html


On Thu, Aug 10, 2017 at 9:26 AM, Dharmesh Ajudiya <d.aj...@maxxton.com> wrote:
I used wicket-jquery-ui-plugins-7.7.0 jar for RangeDatePickerTextField 

My project requirement are
- show only two month at a time (currently it shown 3 month at a time)
- enabled dates still Dec 2018 (currently is enabled for today and past all day  not for future)

Here is my code
    Model<String> rangeModel = Model.of("Any");
    Label rangeHead=new Label("range",rangeModel);
    rangeHead.setOutputMarkupId(true);
    add(rangeHead);

    //RangeDatePicker
    long threeDays = Duration.ONE_DAY.getMilliseconds() * 3;
    long threeDaysAgo = new Date().getTime() - threeDays;
    final IModel<DateRange> model = Model.of(DateRange.of(new Date(), new Date(new Date().getTime() + Duration.ONE_DAY.getMilliseconds() * 365)));
    final RangeDatePickerTextField datePicker = new RangeDatePickerTextField("datepicker", model);
    datePicker.clearInput();
    datePicker.setOutputMarkupId(true);
    add(datePicker);
    
    //Update
    add( new AjaxLink<Void>("update")
    {
      private static final long serialVersionUID = 1L;
      
      @Override
      public void onClick(AjaxRequestTarget target)
      {
         DateRange range = datePicker.getModelObject();
         if(range != null)
         {
           DateFormat df = new SimpleDateFormat("dd MMM");
           df.setTimeZone(DateUtils.UTC); //important
           rangeModel.setObject(String.format("%s - %s", df.format(range.getStart()), df.format(range.getEnd())));
           target.add(rangeHead);
         }
         else
         {
           rangeModel.setObject("Any");
           target.add(rangeHead);
         }
      }
    });

 
I checked but didn't able to find anything 
Please help me on this 

Thanks!


Upcoming events:

2017 VRMA National Conference 15-18 October, Orlando, US
2017 SAS Middle East and Africa 12-13 November, Dubai, UAE  
2017 OPMA Fall Executive Summit 13-15 November, Orlando, US


    

--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-ui+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wicket-jquery-ui/1c352729-cf80-4db0-8bed-a41578d1ad71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages