Calendar widget

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

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Calendar widget

Post by stam » Thu Oct 22, 2020 7:01 pm

Hi all,

I tried to use the (free) Calendar widget on the liveCode store but can't get it to load... i copied the downloaded file to the extensions folder and restarted LC 9.6.1, but there is no way to add this to a card. I also copied it to a 'plugins' folder in the same directory that contains the the extensions folder as I've noticed some plugins won't work otherwise, but again no dice.
No calendar control shows up in the tools palette or in the 'add widget' menu...

What i'm really looking for is a simple date picker.

Can anyone advise if i'm doing something wrong when trying to install this widget or perhaps point me to a better widget?

many thanks
Stam

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: Calendar widget

Post by stam » Thu Oct 22, 2020 7:14 pm

meh please ignore this post... just realised what the process is to install widgets (colour me embarrassed :D )

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: Calendar widget

Post by stam » Mon Oct 26, 2020 5:33 pm

On this note i'll just also add that the best widget i found was Hermann's date picker widget. Not only does it provide a nice API but when viewing the widget's properties in the inspector it exposes the properties so that they can be modified to your needs/taste visually in the IDE... very cool.
(obviously since i've now ...erm.. paid attention on how to install these ;D)

Anyone using anything different/better?

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Sun Nov 22, 2020 9:50 pm

stam wrote:
Thu Oct 22, 2020 7:14 pm
meh please ignore this post... just realised what the process is to install widgets (colour me embarrassed :D )
Hi, I just downloaded the calendar.lce file myself but having never installed an .lce file am unsure of what to do next. Would you mind expanding on your "meh" :)

Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

elanorb
Livecode Staff Member
Livecode Staff Member
Posts: 516
Joined: Fri Feb 24, 2006 9:45 am

Re: Calendar widget

Post by elanorb » Mon Nov 23, 2020 10:37 am

Hi Mark

You install an extension using the Extension Manager from the Tools Palette, just click the '+' button and select your .lce file to install it. It should then show up in the Tools Palette. You can also use the Extension Manager to choose which widgets to show in the Tools Palette, load on startup etc.

I hope that helps.

Kind regards

Elanor
Elanor Buchanan
Software Developer
LiveCode

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: Calendar widget

Post by stam » Mon Nov 23, 2020 3:10 pm

marksmithhfx wrote:
Sun Nov 22, 2020 9:50 pm
stam wrote:
Thu Oct 22, 2020 7:14 pm
meh please ignore this post... just realised what the process is to install widgets (colour me embarrassed :D )
Hi, I just downloaded the calendar.lce file myself but having never installed an .lce file am unsure of what to do next. Would you mind expanding on your "meh" :)

Thanks
Mark
Hi Mark,
What Elanor said - Tools menu -> Extension manager -> "+" (top right) & select the '.lce' file

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Tue Nov 24, 2020 4:42 pm

[/quote]
Hi Mark,
What Elanor said - Tools menu -> Extension manager -> "+" (top right) & select the '.lce' file
[/quote]

Great, thanks guys. I'll be plugging it in tomorrow so your comments are appreciated.

Best,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Sat Nov 28, 2020 9:03 pm

marksmithhfx wrote:
Tue Nov 24, 2020 4:42 pm
Hi Mark,
What Elanor said - Tools menu -> Extension manager -> "+" (top right) & select the '.lce' file
[/quote]

Great, thanks guys. I'll be plugging it in tomorrow so your comments are appreciated.

Best,
Mark
[/quote]

Hi everyone,

Ok, just so I am sure I am not missing a beat, the calendar widget that appears on the LC toolbar does not return a date format that is understood by the LC convert function?

I tried (using a standard built in LC date, the short date)

Code: Select all

put the short date into tDate
convert tDate to dateItems
put tDate
and predictably got 2020,11,28,0,0,0,7 (it being 7:56 PM on a Saturday evening when I did this).

I then tried the same conversion using the date format the widget returns, which is YYYY-MM-DD ie:

Code: Select all

put "2020-11-28" into tDate
convert tDate to dateItems
put tDate
and got "2020-11-28" as an answer. ie. no conversion.

Just trying to make sure I am not missing something obvious before I role my own "yyyy-mm-dd" to "mm/dd/yy" conversion routine.

Thanks
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Calendar widget

Post by Klaus » Sat Nov 28, 2020 9:29 pm

Hi Mark,

yep, the format of the date returned from the widget is erm. un-LC-like, to say the least. :D
Unfortunaltey this is not recognized by LCs "convert" function

So the answer is you need to write a little function which formats that date to a LC friendly one.


Best

Klaus

P.S.
Sounds like a nice enhancement to LC, since this is also the format SQL uses.
Will file an enhancement request.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Calendar widget

Post by Klaus » Sat Nov 28, 2020 9:37 pm


marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Sun Nov 29, 2020 5:04 pm

Klaus wrote:
Sat Nov 28, 2020 9:37 pm
And done:https://quality.livecode.com/show_bug.cgi?id=23004
and Dusted 8)
Attachments
New Convert.livecode.zip
(1.24 KiB) Downloaded 248 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Sun Nov 29, 2020 9:32 pm

Klaus wrote:
Sat Nov 28, 2020 9:37 pm
And done:https://quality.livecode.com/show_bug.cgi?id=23004
Better version. This one handles "date addition" better. Put in 2020-02-31 (Feb 31) and it will return 03/02/20 (Mar 2)
Attachments
New Convert.livecode.zip
(1.2 KiB) Downloaded 235 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Calendar widget

Post by Klaus » Sun Nov 29, 2020 9:35 pm

marksmithhfx wrote:
Sun Nov 29, 2020 9:32 pm
Put in 2020-02-31 (Feb 31)
I would never do that! :-)

SparkOut
Posts: 2945
Joined: Sun Sep 23, 2007 4:58 pm

Re: Calendar widget

Post by SparkOut » Mon Nov 30, 2020 12:12 am

How does it deal with 1967-02-24?

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Calendar widget

Post by marksmithhfx » Mon Nov 30, 2020 12:47 am

SparkOut wrote:
Mon Nov 30, 2020 12:12 am
How does it deal with 1967-02-24?
Pretty good I think. I had to figure out the Calendar widget anyway so I put the conversion routines into the test stack. So far so good, although it seems seriously intolerant of anything that might be an illegal date.
Attachments
Calendar.livecode.zip
(2.62 KiB) Downloaded 255 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply