Date Selection - Folloow up

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Derek Henderson
Posts: 8
Joined: Mon Sep 24, 2012 5:37 pm

Date Selection - Folloow up

Post by Derek Henderson » Sun Jan 18, 2015 6:18 am

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Date Selection - Folloow up

Post by bn » Sun Jan 18, 2015 8:37 am

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

Derek Henderson
Posts: 8
Joined: Mon Sep 24, 2012 5:37 pm

Re: Date Selection - Solved

Post by Derek Henderson » Mon Jan 19, 2015 5:06 am

All working perfectly now. Thank you Bernd, Simon and Sarah.

I am impressed. And glad I chose LC.

Regards
Derek Henderson

Post Reply