DatePicker - Allow setting view date
See original GitHub issuePlease enable a property to set the view date for a p:datePicker
Current hack is very ugly.
<p:datePicker id="salaryDepositsCalendar" widgetVar="salaryDepositsCalendar" inline="true" numberOfMonths="4" selectionMode="multiple" value="#{cc.attrs.data.affobj.depositDates}"
maxdate="#{utils:dateNow()}" maxDateCount="#{cc.attrs.data.affobj.numberOfDeposits}" />
<h:outputScript>
var t = PF('salaryDepositsCalendar');
var tt = t.jq.datePicker();
var ttt = tt.data();
ttt.primeDatePicker.viewDate = new Date('#{cc.attrs.data.affobj.getLastDepositDate()}');
//Literally just to render the view because .refresh() doesn't work (so click the previous button to force it)
$('[id$="salaryDepositsCalendar"] .ui-datepicker-prev').click();
</h:outputScript>
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Bootstrap datetimepicker: set view only date, day not ...
You can try setting date like this: $("#datePicker") .datepicker({ format: "mm/dd/yyyy", autoclose: true }); ...
Read more >Options — bootstrap-datepicker documentation - Read the Docs
Date to view when initially opening the calendar. The internal value of the date remains today as default, but when the datepicker is...
Read more >Datepicker Widget - jQuery UI API Documentation
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality ... Set all date pickers to open on focus or...
Read more >How to set date display format for jQuery datepicker?
Expand the section labeled, "MORE SETTINGS AND VALUES", then select the desired date format from the "Date entry options" select list.
Read more >Change how a date or time is displayed in a date picker, text ...
To format the control to show both the date and time, select the display style that you want for the date in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
PR Submitted. if you need that functionality right now just add this JS to your own JS file.
Beautiful! ❤️