SOLVED - Is there a date/time picker in Live Code?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
admin12
Posts: 412
Joined: Wed May 11, 2011 9:47 am

SOLVED - Is there a date/time picker in Live Code?

Post by admin12 » Fri Jul 08, 2011 3:03 pm

I am going to need quite a few form fields with a date and time picker - is there a native tool in LiveCode for this? I need to return a date and a time. Most database programs have these built in. I know Live Code is not a specific database program, but I see dates and times as a common item.

If not, is there a tutorial, code snippet, rev file or template available to pick the date and a separate on to pick the time?

Mike
Last edited by admin12 on Mon Aug 01, 2011 6:49 am, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4928
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Is there a date/time picker in Live Code?

Post by dunbarx » Fri Jul 08, 2011 4:00 pm

Hi.

LC has comprehensive native system date and time functions. Check the dictionary for "date", "time", "dateitems", "dateformat", etc.

if you mean you want one of those calendar-type pickers, or similar gadgets, I think there are some around written by others. Someone will reply...

Craig Newman

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 773
Joined: Fri Aug 15, 2008 7:15 am

Re: Is there a date/time picker in Live Code?

Post by bangkok » Fri Jul 08, 2011 5:08 pm

This one (Sarah) is perfect :

http://www.troz.net/rev/stacks/Calendar.rev

[Sarah has other scripts on her website, to handle / manage / convert dates and times.]

admin12
Posts: 412
Joined: Wed May 11, 2011 9:47 am

Re: Is there a date/time picker in Live Code?

Post by admin12 » Sat Jul 09, 2011 2:18 pm

Thank you. This is perfect, but it says it is password protected. Is this for sale? How much? Where can I buy it?

Mike

Klaus
Posts: 9588
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Is there a date/time picker in Live Code?

Post by Klaus » Sat Jul 09, 2011 2:28 pm

Hi Mike,

that calendar stack above is NOT password protected!
Just loaded and checked.


Best

Klaus

admin12
Posts: 412
Joined: Wed May 11, 2011 9:47 am

Re: Is there a date/time picker in Live Code?

Post by admin12 » Sat Jul 09, 2011 7:01 pm

That is weird because I tried to grab the code and it told me it was password protected and then closed.

Mike

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 417
Joined: Sun Feb 13, 2011 8:43 pm
Location: Seattle, USA

Re: Is there a date/time picker in Live Code?

Post by townsend » Sat Jul 09, 2011 9:50 pm

Here's the one I have-- not sure where I got it.
Works pretty good though.
Attachments
CalandarPopUp.zip
(5 KiB) Downloaded 2702 times

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: SOLVED - Is there a date/time picker in Live Code?

Post by blairetabay » Tue Mar 18, 2014 4:25 am

towsend,

how to change it to a slash and remove the day of the week


thanks

blaireTabay

Klaus
Posts: 9588
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: SOLVED - Is there a date/time picker in Live Code?

Post by Klaus » Tue Mar 18, 2014 2:50 pm

Hi blaire,

if you do not want to dive into the long script of the Datepicker stack,
then just modify the returned value! :D

Modyfied script from the button in that stack::

Code: Select all

on mouseUp
  put "2014" into tYear
  put "3" into tMonth
  put "18" into tDay
  start using stack "calendarWidget100"
  put altAnswerDate(tYear,tMonth,tDay) into tDate
  stop using stack "calendarWidget100"
  if tDate is empty then 
     exit mouseUp
  end if

  ## Modify tDate to your needs
  ## tDate is a comma delimited list of 4 items: Year,Month,Day,DayofWeek
  ## So only grab the items you need:
  put item 1 to 3 of tDate into tDate2

  ## Replace COMMA with SLASH
  replace "," with "/" in tDate
  ## Done!

  put tDate into fld 1
end mouseUp
Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”