datepicker - aui date picker, calendar with maximumDate attribute -
when set aui datepicker calendar maximumdate attribute, not getting selected (it's kind of weird though). till noon working, later not.
i using liferay 6.2 ee sp8. using hook trying change html\taglib\ui\input_date\page.jsp
<% calendar calendarcurrentdate = calendarfactoryutil.getcalendar(); %> <% if((portalutil.getportletnamespace(portletkeys.journal)).equals(namespace) && name.equals("expirationdate")){ %> calendar: { maximumdate: new date(<%= calendarcurrentdate.get(calendar.year)+1 %>, <%= calendarcurrentdate.get(calendar.month) %>, <%= calendarcurrentdate.get(calendar.day_of_month) %>) }, <% } %>
full datepicker code below
<aui:script use='<%= "aui-datepicker" + (browsersnifferutil.ismobile(request) ? "-native" : stringpool.blank) %>'> liferay.component( '<%= nameid %>datepicker', function() { var datepicker = new a.datepicker<%= browsersnifferutil.ismobile(request) ? "native" : stringpool.blank %>( { container: '#<%= randomnamespace %>displaydate', mask: '<%= mask %>', <% if((portalutil.getportletnamespace(portletkeys.journal)).equals(namespace) && name.equals("expirationdate")){ %> calendar: { maximumdate: new date(<%= calendarcurrentdate.get(calendar.year)+1 %>, <%= calendarcurrentdate.get(calendar.month) %>, <%= calendarcurrentdate.get(calendar.day_of_month) %>) }, <% } %> on: { disabledchange: function(event) { var instance = this; var container = instance.get('container'); var newval = event.newval; console.log('disalbedchange'+newval) container.one('#<%= dayparamid %>').attr('disabled', newval); container.one('#<%= monthparamid %>').attr('disabled', newval); container.one('#<%= nameid %>').attr('disabled', newval); container.one('#<%= yearparamid %>').attr('disabled', newval); }, selectionchange: function(event) { var instance = this; var container = instance.get('container'); var date = event.newselection[0]; console.log("event >"+event); console.log("date >"+date); if (date) { container.one('#<%= dayparamid %>').val(date.getdate()); container.one('#<%= monthparamid %>').val(date.getmonth()); container.one('#<%= yearparamid %>').val(date.getfullyear()); } } }, popover: { zindex: liferay.zindex.tooltip }, trigger: '#<%= nameid %>' } ); datepicker.getdate = function() { var instance = this; var container = instance.get('container'); return new date(container.one('#<%= yearparamid %>').val(), container.one('#<%= monthparamid %>').val(), container.one('#<%= dayparamid %>').val()); }; return datepicker; } ); liferay.component('<%= nameid %>datepicker');
any appreciated. related timezone.
try select max date date, next when click in input box - input value becomes blank. not case if select other dates prior max date. max date 1 year current date
js fiddle
http://jsfiddle.net/uasvug1h/1/(alloy 3 working)
http://jsfiddle.net/btnkumar/uasvug1h/2/(alloy 2 not working)
how make work in alloy 2
this bug in alloyui 2.0.x
. has been fixed in 3.0.x
, 2.0.x
, 2.0.0.62-deprecated
release. currently, there no known workarounds.
Comments
Post a Comment