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

LiveCode is RunRev's 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, robinmiller, kevinmiller

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

Postby 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.
admin12
 
Posts: 412
Joined: Wed May 11, 2011 9:47 am

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

Postby 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2436
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Postby 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.]
bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 708
Joined: Fri Aug 15, 2008 7:15 am

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

Postby 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
admin12
 
Posts: 412
Joined: Wed May 11, 2011 9:47 am

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

Postby Klaus » Sat Jul 09, 2011 2:28 pm

Hi Mike,

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


Best

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

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

Postby 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
admin12
 
Posts: 412
Joined: Wed May 11, 2011 9:47 am

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

Postby 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 2036 times
townsend
Livecode Opensource Backer
Livecode Opensource Backer
 
Posts: 397
Joined: Sun Feb 13, 2011 8:43 pm
Location: Seattle, USA

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

Postby 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
blairetabay
 
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

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

Postby 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
Klaus
 
Posts: 6566
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany


Return to Getting Started with LiveCode - Experienced Developers

Who is online

Users browsing this forum: No registered users and 1 guest