mobilePickdate problem

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
Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

mobilePickdate problem

Post by Jellobus » Fri Sep 26, 2014 6:12 am

Hi all,

With mobilePickdate on Android platform, Sep 01, 1914 and Sep 01, 2014 and it returns same value of 9/01/14.

Is there any way to get a four digit year value on both ios and android?

Cheers,

Louis

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: mobilePickdate problem

Post by Mark » Fri Sep 26, 2014 11:15 am

Hi Louis,

That is funny, because the documentation says it should return a value in seconds rather than a date. Could you post your entire script?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: mobilePickdate problem

Post by Jellobus » Fri Sep 26, 2014 6:13 pm

Hi Mark,

This is the script,

Code: Select all

local tDateResult
on mouseUp
   mobilePickDate "date"
   put the result into tDateResult
   convert tDateResult from seconds to internet date
   put tDateResult into field 1
end mouseUp
Internet date supposed to give four digit year value I think.. but it doesn't. :roll:
Anything wrong with this script?


Cheers,

Louis

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: mobilePickdate problem

Post by Mark » Fri Sep 26, 2014 7:34 pm

Hi Louis,

Nothing is wrong with your script. Apparently, the date picker doesn't return the seconds but a date in the format mm/dd/yy. Probably, this is okay for dates after 1 Jan. 1970 but not for earlier dates. I think this is a bug in LiveCode.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: mobilePickdate problem

Post by Jellobus » Fri Sep 26, 2014 8:33 pm

Hi Mark,

Thanks for clarifying that it was a bug. I decided to use mobilePick instead of mobilePickdate. but it looks not as fancy as a wheel type native date picker. It's just plain field with list of contents...Can I change it to any other style? also I have a problem with cancel button.. I like to exit mouseUp upon user press a cancel button but it seems not working with my script.

Code: Select all

on mouseUp   
   mobilePick tMonths, tInitialIndex,"cancel"
   if it is "cancel" then
      put empty into tDateResult
      put empty into field 1
      exit mouseUp
   end if
   put the result into tDateResult
   put tDateResult into field 1
end mouseUp
Cheers,

Louis

Post Reply