留言板
how to get aui-calender selected date value?
srikanth davuluri,修改在12 年前。
how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi All....
could you please provide code to get selected date in input text box using aui-calender
Thanks in Advance..
Regards
Srikanth Davuluri.
could you please provide code to get selected date in input text box using aui-calender
Thanks in Advance..
Regards
Srikanth Davuluri.
Juhi Kumari,修改在12 年前。
RE: how to get aui-calender selected date value?
Expert 帖子: 347 加入日期: 11-12-12 最近的帖子
Hi
Use this code to get selected date in input text box using aui-calender.
startDate is the id of that text box where you want the selected date.
Regards
Juhi
Use this code to get selected date in input text box using aui-calender.
<aui:script>
var startCal;
var endCal;
AUI().ready('aui-calendar', function(A) {
startCal = new A.Calendar({
trigger : '#<portlet:namespace />startDate',
dateFormat : '%d/%m/%Y',
selectMultipleDates : false,
on : {
select : function(event) {
endCal.set('minDate', startCal.getCurrentDate());
endCal.syncUI();
}
}
}).render();
A.on('mousedown', function() {
A.CalendarManager.hideAll();
}, document);
});
</aui:script>
startDate is the id of that text box where you want the selected date.
Regards
Juhi
srikanth davuluri,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi Juhi Kumari,
i tried with above code but it is displaying only text box could you please explain clearly with sample jsp page.
i tried with above code but it is displaying only text box could you please explain clearly with sample jsp page.
Juhi Kumari,修改在12 年前。
RE: how to get aui-calender selected date value?
Expert 帖子: 347 加入日期: 11-12-12 最近的帖子
Hi srikanth
Use this aui taglib in your jsp and make a text box with name 'startDate'. When you click in that text box that time this calendar should trigger.
Remove these lines
var endCal;
endCal.set('minDate', startCal.getCurrentDate());
endCal.syncUI();
Please let me know if you have any problem.
Regards
Juhi
Use this aui taglib in your jsp and make a text box with name 'startDate'. When you click in that text box that time this calendar should trigger.
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
Remove these lines
var endCal;
endCal.set('minDate', startCal.getCurrentDate());
endCal.syncUI();
Please let me know if you have any problem.
Regards
Juhi
srikanth davuluri,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi
still facing same problem calender picker is displaying in header and text filed displaying in body.
please provide complete jsp page so that i will implement.
still facing same problem calender picker is displaying in header and text filed displaying in body.
please provide complete jsp page so that i will implement.
Bavithra Rajendran,修改在12 年前。
RE: how to get aui-calender selected date value?
Regular Member 帖子: 123 加入日期: 09-10-8 最近的帖子
Hi,
You can try this
Thanks,
Bavithra Rajendran
You can try this
<input type="text" size="50" id="myDatepicker">
<script type="text/javascript" charset="utf-8">
AUI().use('aui-datepicker', function(A) {
var simpleDatepicker1 = new A.DatePicker({
trigger: '#myDatepicker',
dateFormat: '%d/%m/%y %A',
setValue: true,
minDate: '01/01/2000',
maxDate: '09/05/2020',
selectMultipleDates: false
})
.render();
});
</script>
Thanks,
Bavithra Rajendran
srikanth davuluri,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi Bavithra Rajendran
thanks for your response it is working fine but i am unable to set minDate and maxDate in calender could you please provide solution.
thanks for your response it is working fine but i am unable to set minDate and maxDate in calender could you please provide solution.
Bavithra Rajendran,修改在12 年前。
RE: how to get aui-calender selected date value? (答复)
Regular Member 帖子: 123 加入日期: 09-10-8 最近的帖子
Add the attributes inside calendar: {}. It will work. The code should be like this
Thanks,
Bavithra Rajendran
<input type="text" size="50" id="myDatepicker">
<script type="text/javascript" charset="utf-8">
AUI().use('aui-datepicker', function(A) {
var simpleDatepicker1 = new A.DatePicker({
trigger: '#myDatepicker',
calendar: {
dateFormat: '%d/%m/%y %A',
setValue: true,
minDate: '01/01/2011',
maxDate: '09/05/2012',
selectMultipleDates: false
}
})
.render();
});
</script>
Thanks,
Bavithra Rajendran
Srikanth Davuluri,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Thanks for your response
it is working fine...
it is working fine...
RathnaDevi Chellaiah,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 29 加入日期: 12-3-27 最近的帖子
Hi Bavithra Rajendran,
The code which u posted was very useful for me .. i was breaking my head for whole day to use calendar with a simple code.. thanks a lot
The code which u posted was very useful for me .. i was breaking my head for whole day to use calendar with a simple code.. thanks a lot
ruchi sharma,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 95 加入日期: 11-3-24 最近的帖子
Hello friends,
I also want to do the same stuff...
I have tried to use the same code given by Bavithra, but i am just getting the text field and when i click on it nothing happen.
Why i am not getting the calender??
Is their any wrong syntax??
Below is my jsp :
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<div>
<input type="text" size="50" id="myDatepicker" />
</div>
<script type="text/javascript" charset="utf-8">
AUI().use('aui-datepicker', function(A) {
var simpleDatepicker1 = new A.DatePicker({
trigger: '#myDatepicker',
calendar: {
dateFormat: '%d/%m/%y %A',
setValue: true,
minDate: '01/01/2011',
maxDate: '09/05/2012',
selectMultipleDates: false
}
}).render();
});
</script>
Any help would be appreciated.
Thanks
Ruchi
I also want to do the same stuff...
I have tried to use the same code given by Bavithra, but i am just getting the text field and when i click on it nothing happen.
Why i am not getting the calender??
Is their any wrong syntax??
Below is my jsp :
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<div>
<input type="text" size="50" id="myDatepicker" />
</div>
<script type="text/javascript" charset="utf-8">
AUI().use('aui-datepicker', function(A) {
var simpleDatepicker1 = new A.DatePicker({
trigger: '#myDatepicker',
calendar: {
dateFormat: '%d/%m/%y %A',
setValue: true,
minDate: '01/01/2011',
maxDate: '09/05/2012',
selectMultipleDates: false
}
}).render();
});
</script>
Any help would be appreciated.
Thanks
Ruchi
Srikanth Davuluri,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi Ruchi,
nothing wrong in your code i executed. it is working fine in my system whats happening in your machine i don't know. Try to execute it in sample / test portlet then you can find mistake.
Thanks
Srikanth Davuluri
nothing wrong in your code i executed. it is working fine in my system whats happening in your machine i don't know. Try to execute it in sample / test portlet then you can find mistake.
Thanks
Srikanth Davuluri
ruchi sharma,修改在12 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 95 加入日期: 11-3-24 最近的帖子
Thanks Srikanth,
Still surprised its not working .
I have had tried with test portlet individuality, sill is not working.
Then I used jquery for datepicker
Script Code :
<script type="text/javascript">
jQuery(document).ready(function() {
console.log("hello1");
jQuery("#startdatepicker").datepicker();
});
</script>
Code :
This following single line of code is to be added
<p>Start Date: <input type="text" id="startdatepicker"></p>
its working in my test portlet but not working where i want to do (i want to call this in my configuration.jsp(which is a popup) of my portlet).
Is anybody think of anything else.
thanks
Ruchi
Still surprised its not working .
I have had tried with test portlet individuality, sill is not working.
Then I used jquery for datepicker
Script Code :
<script type="text/javascript">
jQuery(document).ready(function() {
console.log("hello1");
jQuery("#startdatepicker").datepicker();
});
</script>
Code :
This following single line of code is to be added
<p>Start Date: <input type="text" id="startdatepicker"></p>
its working in my test portlet but not working where i want to do (i want to call this in my configuration.jsp(which is a popup) of my portlet).
Is anybody think of anything else.
thanks
Ruchi
Sanket Gosavi,修改在11 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 35 加入日期: 11-12-24 最近的帖子
What if i want to show calendar on front for selecting date....i want user to click on calender directly and select date...not on textbox...Any help plz
mohammad azaruddin,修改在9 年前。
RE: how to get aui-calender selected date value?
Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Hi ruchi
did you resolve this issue
It seems the above code will not work for LR6.2
did you resolve this issue
It seems the above code will not work for LR6.2
vinod kumar,修改在9 年前。
RE: how to get aui-calender selected date value?
Junior Member 帖子: 64 加入日期: 12-10-4 最近的帖子
Hi Mohammad,
i am facing the same problem have you resolved the date picker in LR6.2.
i am facing the same problem have you resolved the date picker in LR6.2.
Kyle Joseph Stiemann,修改在9 年前。
RE: how to get aui-calender selected date value?
Liferay Master 帖子: 760 加入日期: 13-1-14 最近的帖子
Hi Guys,
In order to do this in Liferay Portal 6.2, you need to use the AlloyUI 2.0 Datepicker.
The code would look something like this:
- Kyle
In order to do this in Liferay Portal 6.2, you need to use the AlloyUI 2.0 Datepicker.
The code would look something like this:
<div>
<input type="text" id="myDatepicker">
</div>
<script type="text/javascript">
AUI().use('aui-datepicker', function(A) {
new A.DatePicker({
trigger: '#myDatepicker',
popover: { zIndex: 99999 },
mask: '%d/%m/%y %A',
calendar: {
minimumDate: new Date(2011,00,01),
maximumDate: new Date(2012,08,05),
selectionMode: 'multiple'
}
}).render();
});
</script>
- Kyle
mohammad azaruddin,修改在9 年前。
RE: how to get aui-calender selected date value?
Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Thanks Kyle Joseph Stiemann
The above code will work fine But Do you have any solution for the same in portlet-model-hints.xml when we use <aui:model-context bean="" model="" />.
where as <hint name="year-range-past">false</hint> doesn't seems to work in UI level
The above code will work fine But Do you have any solution for the same in portlet-model-hints.xml when we use <aui:model-context bean="" model="" />.
where as <hint name="year-range-past">false</hint> doesn't seems to work in UI level
Kyle Joseph Stiemann,修改在9 年前。
RE: how to get aui-calender selected date value?
Liferay Master 帖子: 760 加入日期: 13-1-14 最近的帖子
Hi Mohammad,
I'm glad the code is working for you. You should post this question in a new thread since it is a new topic.
- Kyle
I'm glad the code is working for you. You should post this question in a new thread since it is a new topic.
- Kyle
mohammad azaruddin,修改在9 年前。
RE: how to get aui-calender selected date value?
Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Yeah you are right
Mazhar Alam,修改在11 年前。
RE: how to get aui-calender selected date value?
Regular Member 帖子: 191 加入日期: 11-11-25 最近的帖子
Helpful post Bavithra!!