Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
how to get aui-calender selected date value? Srikanth Davuluri January 2, 2012 9:02 PM
RE: how to get aui-calender selected date value? Juhi Kumari January 2, 2012 9:25 PM
RE: how to get aui-calender selected date value? Srikanth Davuluri January 2, 2012 9:40 PM
RE: how to get aui-calender selected date value? Juhi Kumari January 2, 2012 10:10 PM
RE: how to get aui-calender selected date value? Srikanth Davuluri January 2, 2012 10:24 PM
RE: how to get aui-calender selected date value? Bavithra Rajendran January 2, 2012 11:40 PM
RE: how to get aui-calender selected date value? Srikanth Davuluri January 2, 2012 11:13 PM
RE: how to get aui-calender selected date value? Bavithra Rajendran January 3, 2012 1:02 AM
RE: how to get aui-calender selected date value? Srikanth Davuluri January 3, 2012 3:09 AM
RE: how to get aui-calender selected date value? RathnaDevi Chellaiah March 26, 2012 10:30 PM
RE: how to get aui-calender selected date value? ruchi sharma April 18, 2012 7:52 AM
RE: how to get aui-calender selected date value? Srikanth Davuluri April 18, 2012 9:15 PM
RE: how to get aui-calender selected date value? ruchi sharma April 23, 2012 8:28 AM
RE: how to get aui-calender selected date value? Sanket Gosavi May 9, 2012 8:59 AM
RE: how to get aui-calender selected date value? mohammad azaruddin June 8, 2014 7:54 AM
RE: how to get aui-calender selected date value? kumar E June 22, 2014 11:25 PM
RE: how to get aui-calender selected date value? Kyle Joseph Stiemann July 11, 2014 12:36 PM
RE: how to get aui-calender selected date value? mohammad azaruddin July 14, 2014 11:23 PM
RE: how to get aui-calender selected date value? Kyle Joseph Stiemann July 15, 2014 6:52 AM
RE: how to get aui-calender selected date value? mohammad azaruddin July 15, 2014 9:16 PM
RE: how to get aui-calender selected date value? Mazhar Alam November 7, 2012 2:08 AM
Srikanth Davuluri
how to get aui-calender selected date value?
January 2, 2012 9:02 PM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

Hi All....

could you please provide code to get selected date in input text box using aui-calender

Thanks in Advance..

Regards
Srikanth Davuluri.
Juhi Kumari
RE: how to get aui-calender selected date value?
January 2, 2012 9:25 PM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi

Use this code to get selected date in input text box using aui-calender.
 1
 2<aui:script>
 3    var startCal;
 4    var endCal;
 5    AUI().ready('aui-calendar', function(A) {
 6        startCal = new A.Calendar({
 7            trigger : '#<portlet:namespace />startDate',
 8            dateFormat : '%d/%m/%Y',
 9            
10            selectMultipleDates : false,
11            on : {
12                select : function(event) {
13                    endCal.set('minDate', startCal.getCurrentDate());
14                    endCal.syncUI();
15                }
16            }
17        }).render();
18
19        A.on('mousedown', function() {
20            A.CalendarManager.hideAll();
21        }, document);
22
23    });
24</aui:script>


startDate is the id of that text box where you want the selected date.


Regards
Juhi
Srikanth Davuluri
RE: how to get aui-calender selected date value?
January 2, 2012 9:40 PM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

Hi Juhi Kumari,

i tried with above code but it is displaying only text box could you please explain clearly with sample jsp page.
Juhi Kumari
RE: how to get aui-calender selected date value?
January 2, 2012 10:10 PM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

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.
1<%@ 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
RE: how to get aui-calender selected date value?
January 2, 2012 10:24 PM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

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.
Bavithra Rajendran
RE: how to get aui-calender selected date value?
January 2, 2012 11:40 PM
Answer

Bavithra Rajendran

LIFERAY STAFF

Rank: Regular Member

Posts: 123

Join Date: October 7, 2009

Recent Posts

Hi,

You can try this
 1<input type="text" size="50" id="myDatepicker" />
 2
 3<script type="text/javascript" charset="utf-8">
 4AUI().use('aui-datepicker', function(A) {
 5    var simpleDatepicker1 = new A.DatePicker({
 6        trigger: '#myDatepicker',
 7        dateFormat: '%d/%m/%y %A',
 8        setValue: true,
 9        minDate: '01/01/2000',
10        maxDate: '09/05/2020',
11        selectMultipleDates: false
12    })
13    .render();
14});
15</script>


Thanks,
Bavithra Rajendran
Srikanth Davuluri
RE: how to get aui-calender selected date value?
January 2, 2012 11:13 PM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

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.
Bavithra Rajendran
RE: how to get aui-calender selected date value?
January 3, 2012 1:02 AM
Answer

Bavithra Rajendran

LIFERAY STAFF

Rank: Regular Member

Posts: 123

Join Date: October 7, 2009

Recent Posts

Add the attributes inside calendar: {}. It will work. The code should be like this
 1
 2<input type="text" size="50" id="myDatepicker" />
 3
 4<script type="text/javascript" charset="utf-8">
 5AUI().use('aui-datepicker', function(A) {
 6    var simpleDatepicker1 = new A.DatePicker({
 7        trigger: '#myDatepicker',
 8        calendar: {
 9        dateFormat: '%d/%m/%y %A',
10        setValue: true,
11        minDate: '01/01/2011',
12        maxDate: '09/05/2012',
13        selectMultipleDates: false
14        }
15    })
16    .render();
17});
18</script>


Thanks,
Bavithra Rajendran
Srikanth Davuluri
RE: how to get aui-calender selected date value?
January 3, 2012 3:09 AM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

Thanks for your response

it is working fine...
RathnaDevi Chellaiah
RE: how to get aui-calender selected date value?
March 26, 2012 10:30 PM
Answer

RathnaDevi Chellaiah

Rank: Junior Member

Posts: 29

Join Date: March 26, 2012

Recent Posts

Hi Bavithra Rajendran,
The code which u posted was very useful for me ..emoticon i was breaking my head for whole day to use calendar with a simple code.. thanks a lotemoticon
ruchi sharma
RE: how to get aui-calender selected date value?
April 18, 2012 7:52 AM
Answer

ruchi sharma

Rank: Junior Member

Posts: 95

Join Date: March 24, 2011

Recent Posts

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
Srikanth Davuluri
RE: how to get aui-calender selected date value?
April 18, 2012 9:15 PM
Answer

Srikanth Davuluri

Rank: Junior Member

Posts: 25

Join Date: June 7, 2011

Recent Posts

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
ruchi sharma
RE: how to get aui-calender selected date value?
April 23, 2012 8:28 AM
Answer

ruchi sharma

Rank: Junior Member

Posts: 95

Join Date: March 24, 2011

Recent Posts

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
Sanket Gosavi
RE: how to get aui-calender selected date value?
May 9, 2012 8:59 AM
Answer

Sanket Gosavi

Rank: Junior Member

Posts: 35

Join Date: December 24, 2011

Recent Posts

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
Mazhar Alam
RE: how to get aui-calender selected date value?
November 7, 2012 2:08 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Helpful post Bavithra!!
mohammad azaruddin
RE: how to get aui-calender selected date value?
June 8, 2014 7:54 AM
Answer

mohammad azaruddin

Rank: Expert

Posts: 441

Join Date: September 17, 2012

Recent Posts

Hi ruchi
did you resolve this issue
It seems the above code will not work for LR6.2
kumar E
RE: how to get aui-calender selected date value?
June 22, 2014 11:25 PM
Answer

kumar E

Rank: Junior Member

Posts: 57

Join Date: October 3, 2012

Recent Posts

Hi Mohammad,

i am facing the same problem have you resolved the date picker in LR6.2.
Kyle Joseph Stiemann
RE: how to get aui-calender selected date value?
July 11, 2014 12:36 PM
Answer

Kyle Joseph Stiemann

LIFERAY STAFF

Rank: Regular Member

Posts: 128

Join Date: January 14, 2013

Recent Posts

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:
 1<div>
 2    <input type="text" id="myDatepicker" />
 3</div>
 4<script type="text/javascript">
 5AUI().use('aui-datepicker', function(A) {
 6    new A.DatePicker({
 7    trigger: '#myDatepicker',
 8    popover: { zIndex: 99999 },
 9    mask: '%d/%m/%y %A',
10    calendar: {
11        minimumDate: new Date(2011,00,01),
12        maximumDate: new Date(2012,08,05),
13        selectionMode: 'multiple'
14    }
15    }).render();
16});
17</script>

- Kyle
mohammad azaruddin
RE: how to get aui-calender selected date value?
July 14, 2014 11:23 PM
Answer

mohammad azaruddin

Rank: Expert

Posts: 441

Join Date: September 17, 2012

Recent Posts

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
Kyle Joseph Stiemann
RE: how to get aui-calender selected date value?
July 15, 2014 6:52 AM
Answer

Kyle Joseph Stiemann

LIFERAY STAFF

Rank: Regular Member

Posts: 128

Join Date: January 14, 2013

Recent Posts

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
mohammad azaruddin
RE: how to get aui-calender selected date value?
July 15, 2014 9:16 PM
Answer

mohammad azaruddin

Rank: Expert

Posts: 441

Join Date: September 17, 2012

Recent Posts

Yeah you are right emoticon