Page 1 of 1

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

Posted: Fri Jul 08, 2011 3:03 pm
by admin12
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

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

Posted: Fri Jul 08, 2011 4:00 pm
by dunbarx
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

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

Posted: Fri Jul 08, 2011 5:08 pm
by bangkok
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.]

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

Posted: Sat Jul 09, 2011 2:18 pm
by admin12
Thank you. This is perfect, but it says it is password protected. Is this for sale? How much? Where can I buy it?

Mike

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

Posted: Sat Jul 09, 2011 2:28 pm
by Klaus
Hi Mike,

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


Best

Klaus

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

Posted: Sat Jul 09, 2011 7:01 pm
by admin12
That is weird because I tried to grab the code and it told me it was password protected and then closed.

Mike

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

Posted: Sat Jul 09, 2011 9:50 pm
by townsend
Here's the one I have-- not sure where I got it.
Works pretty good though.

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

Posted: Tue Mar 18, 2014 4:25 am
by blairetabay
towsend,

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


thanks

blaireTabay

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

Posted: Tue Mar 18, 2014 2:50 pm
by Klaus
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

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

Posted: Thu Oct 12, 2023 7:53 pm
by cmhjon
Hi all,

I'd like to include this product in a project I am working on but noticed something odd in the original stack. If I click forward to view future months, it's highlighting more than one day in the current month and it highlights a day or days in future months:
Screen Shot 2023-10-12 at 2.42.52 PM.jpg
Screen Shot 2023-10-12 at 2.42.52 PM.jpg (31.54 KiB) Viewed 2833 times
Screen Shot 2023-10-12 at 2.42.58 PM.jpg
Screen Shot 2023-10-12 at 2.42.58 PM.jpg (31.51 KiB) Viewed 2833 times
Screen Shot 2023-10-12 at 2.44.10 PM.jpg
Screen Shot 2023-10-12 at 2.44.10 PM.jpg (31.38 KiB) Viewed 2833 times
I would think the only date that should be initially highlighted would be the current date and then only the date the user selects.

Anyone using this product have any ideas?

Thank you and best regards,
Jon :-)