Page 1 of 1

Date Selection - Folloow up

Posted: Sun Jan 18, 2015 6:18 am
by Derek Henderson
Much thanks to Simon who recommended Sarah Reichelt's calendar which I have found to be most suitable. :)

I have one outstanding issue which has me stumped. I have placed a button and a text field on a card in the main stack. The purpose being to click the button to display the calendar and then to select a date which should appear in the field. The button, when clicked, does display the calendar window and a date can be selected. However I have been unsuccessful in displaying the selected date in the field on the card in the main stack. What code do I need and where should it be placed?

The mouse up code of the button calling the calendar is:
on mouseUp
go to stack "DMH copy of MediumCalendar"
end mouseUp

Many thanks for any assistance.

Derek Henderson

Re: Date Selection - Folloow up

Posted: Sun Jan 18, 2015 8:37 am
by bn
Hi Derek,

If you installed the Calendar via the installer of the demo stack then there is a function placed in the script of your stack.
it starts
function getDate pStartingDate, pCalendarStackName
You dont't have to worry about that function, it just has to be there.

If that script is installed all you should have to do in your button is:

Code: Select all

on mouseUp
   put the short english date into pStartingDate
   put "DMH copy of MediumCalendar" into pCalendarStackName
   put getDate (pStartingDate, pCalendarStackName) into tDate
   put tDate into field "myDateDisplayField"
end mouseUp
Kind regards
Bernd

Re: Date Selection - Solved

Posted: Mon Jan 19, 2015 5:06 am
by Derek Henderson
All working perfectly now. Thank you Bernd, Simon and Sarah.

I am impressed. And glad I chose LC.

Regards
Derek Henderson