Ios date picker
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Ios date picker
Hi all,
I make a simple stack which use to test the IOS date picker. I put the following code into a button script
on mouseUp
local tDateResult
// launch the date picker
iphonePickDate "date"
// get the result
put the result into tDateResult
// check and display the result in the text field
if tDateResult is 0 then
put "No Selection Made" into field "DateField"
else
convert tDateResult from seconds to abbreviated date
put tDateResult into field "DateField"
end if
end mouseUp
When I run this stack, it return the following error
execution error at line 4 (Handler: can't find handler) near "iphonePickDate"
Am I missing something. Please advise
Regards
Terry Ho
I make a simple stack which use to test the IOS date picker. I put the following code into a button script
on mouseUp
local tDateResult
// launch the date picker
iphonePickDate "date"
// get the result
put the result into tDateResult
// check and display the result in the text field
if tDateResult is 0 then
put "No Selection Made" into field "DateField"
else
convert tDateResult from seconds to abbreviated date
put tDateResult into field "DateField"
end if
end mouseUp
When I run this stack, it return the following error
execution error at line 4 (Handler: can't find handler) near "iphonePickDate"
Am I missing something. Please advise
Regards
Terry Ho
Re: Ios date picker
Hi Terry...
Very quickly as an example, this should work for you
be well
Dixie
Very quickly as an example, this should work for you
Code: Select all
on mouseUp
put the long date into dateVariable
convert dateVariable to seconds
put abs(dateVariable) into dateChosen
iphonePickDate "dateTime", "dateChosen"
put the result into fld 1
end mouseUp
Dixie
Re: Ios date picker
Hi Terry,
"iphonePickDate" was introduced in LiveCode 4.6.4!
So my quick guess: Are you using this version?
Best
Klaus
"iphonePickDate" was introduced in LiveCode 4.6.4!
So my quick guess: Are you using this version?

Best
Klaus
Re: Ios date picker
Hi all,
I'm using 4.64 and the latest version.
Hi Dixie, You method does not work, it also has the same problem in the "iphonePickDate", which can not find the handler.
I think I must miss some library to call the IphonePickdate function.
Can anyone advise me what I'm missing.
Regards
Terry Ho
I'm using 4.64 and the latest version.
Hi Dixie, You method does not work, it also has the same problem in the "iphonePickDate", which can not find the handler.
I think I must miss some library to call the IphonePickdate function.
Can anyone advise me what I'm missing.
Regards
Terry Ho
Re: Ios date picker
Terry...
Dixie
Mmm.. can't help then, as it works hereHi Dixie, You method does not work, it also has the same problem in the "iphonePickDate", which can not find the handler.
Dixie
Re: Ios date picker
Hi Terry,
I think I got it!
You are running the script in the IDE, right?
Unfortunately the desktop engine (the IDE) does not recognize iOS specific syntax!
So you need to check the environment:
Yes, this is more than inconvenient and can only be tested on the real device or simulator,
but is the only way to go
Best
Klaus
I think I got it!

You are running the script in the IDE, right?
Unfortunately the desktop engine (the IDE) does not recognize iOS specific syntax!
So you need to check the environment:
Code: Select all
on mouseUp
## ONLY execute in iOS devide or simulator!
if the environment <> "mobile" then
exit mouseup
end if
put the long date into dateVariable
convert dateVariable to seconds
put abs(dateVariable) into dateChosen
iphonePickDate "dateTime", "dateChosen"
put the result into fld 1
end mouseUp
but is the only way to go

Best
Klaus
Re: Ios date picker
Hi Klaus
I think you hit the target. But I still can not run in IOS simulator in my Mac machine.
I think the problem is come from the Mac OS (Target).
Regards
Terry Ho
I think you hit the target. But I still can not run in IOS simulator in my Mac machine.
I think the problem is come from the Mac OS (Target).
Regards
Terry Ho