I am fairly new to IOS development but have been using Revolution for a long time. I am retired now so I have lots of time to "get serious'. I saw the mobileDatePick function and thought it was perfect for my app to date entry. I am starting to wonder?
mobilePickDate [style] [, current] [, start] [, end] [, step] [, buttons]
I am using "date" for style
Current is set to either an already entered value of a target field or the current date
start and end are string dates in the format "M/D/Y" like "1/2/2014"
Some issues:
1) When I set the start and end they don't seem to be reflected in the wheels? I can select dates outside the range.
2) When I select a date later than 1/19/2038 it returns so goofy date like "12/13/2001"
3) If I put the result of the function into a field it displsys as the short date with a two digit year..con fusding if one needs distant dates.
4) on the iPad (and simulator) the date selections are showan as a couple "bubble" shapes somewhere up the card well above the control that select3ed them.
On smaller devices a control is at the botton of the screen.
is there something I might be doing wrong.Is there a work around for the date issue beyond 2038 ??
Thanks
Russ
mobilePickDate
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: mobilePickDate
Russ hi,
1.
I'm saying *advice*, because I tested with your format, i.e not converting to seconds, and it worked.
Although, it worked a little weird.
The dates out of the range are still viewable but not selectable in iOS 7.
They are greyed out but you can see them, even scroll to them.
If you release the picker wheel on a date/time out of the range, the wheel reverts back to the closest limit.
If this is the native implementation of iOS 7, that means Apple's engineers are getting dumber and dumber everyday; since it's pretty confusing for the user.
If not, then it's a bug of Livecode and we should report it.
Unfortunately, I don't have any native app with a date picker which has a limited range of date or time; so, I can't test this issue.
2.
Again, I don't know the reason and I don't know if this is a fault of Apple or Livecode.
3.
4.
The picker wheel shows up at the bottom on an iPhone/iPod and as a pop-up on an iPad.
But the little arrow of pop-up picker wheel of iPad should contact to your control.
If not, then there's another problem with your app.
Try with a stripped out stack to pinpoint the issue.
Create a one-button stack, put this into the script of button:
Run it on the iPad simulator.
Move the button around and check if it works right at each location.
Like I said, the arrow of the pop-up picker should point the button.
Hope it helps...
Best,
~ Ender
1.
Try converting your start and end dates to seconds; that's dictionary's advice.srbarlow3 wrote:When I set the start and end they don't seem to be reflected in the wheels? I can select dates outside the range.
Code: Select all
convert tStartDate to seconds
Although, it worked a little weird.
The dates out of the range are still viewable but not selectable in iOS 7.
They are greyed out but you can see them, even scroll to them.
If you release the picker wheel on a date/time out of the range, the wheel reverts back to the closest limit.
If this is the native implementation of iOS 7, that means Apple's engineers are getting dumber and dumber everyday; since it's pretty confusing for the user.
If not, then it's a bug of Livecode and we should report it.
Unfortunately, I don't have any native app with a date picker which has a limited range of date or time; so, I can't test this issue.
2.
Yes, it does.srbarlow3 wrote: When I select a date later than 1/19/2038 it returns so goofy date like "12/13/2001"
Again, I don't know the reason and I don't know if this is a fault of Apple or Livecode.
3.
You can format the result the way you need:srbarlow3 wrote:If I put the result of the function into a field it displsys as the short date with a two digit year..con fusding if one needs distant dates.
Code: Select all
convert tResult to ...
The latter is the default behavior.srbarlow3 wrote:on the iPad (and simulator) the date selections are showan as a couple "bubble" shapes somewhere up the card well above the control that select3ed them.
On smaller devices a control is at the botton of the screen.
The picker wheel shows up at the bottom on an iPhone/iPod and as a pop-up on an iPad.
But the little arrow of pop-up picker wheel of iPad should contact to your control.
If not, then there's another problem with your app.
Try with a stripped out stack to pinpoint the issue.
Create a one-button stack, put this into the script of button:
Code: Select all
local isDragging
on mouseDown
put true into isDragging
end mouseDown
on mouseMove pX, pY
if isDragging then set the loc of me to pX,pY
end mouseMove
on mouseUp
put false into isDragging
mobilePickDate
end mouseUp
Move the button around and check if it works right at each location.
Like I said, the arrow of the pop-up picker should point the button.
Hope it helps...
Best,
~ Ender
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8