Fancy new control, UDCalendar

Evening lads,
So for some reason i wanted to create a calendar-control for universal dashboard.
Simple enough, eh? The timezone troubleshooting was terrible, and reminded me once again why i hate dealing with time.
Anywhomst, the stuff works and is published to the powershell gallery.
Give it a go with

Install-module UniversalDashboard.UD-Calendar

See


For more info.
Examble usage:

Fancy photo:

Also added two more functions to simplify the handling of time, check the example script for usage of “Out-UDCalDate” and “Get-UDCalElement”.

2 Likes

Clean, simple, easy to use, great examples… Perfect!

1 Like

Nice @BoSen29 great work…I was doing a calendar TO and FROM picker…but have issues doing the binding bit to UD to use the element result. So parked that for the moment.

Thanks @psDevUK,

can not recommend to go down that rabbit’s hole. I overcomplicated everything, and spent hours on the formatting in order to get the damn timezones to function correctly.
In the end, i had the events working fine, but the get-udelement functionality returned without timezones. Tried for a couple of more hours on the powershell side to force timezones etc, when it turned out to be a simple js function needed.

Anywhomst: this calendar should be able to have time-ranges, and show icons for events etc. Feel free to play with it and throw in a PR if you make anything fancy.
I’ll probably add more functionality to it, if i ever forget the pain of timezones.

You cool to post jsx file. My problem is reading the value from the state of the control. Would like to see how you achieved this. Please and thank you

Bro, @psDevUK, i cheated, real bad.
Did a dirty.

The this.state.date is only the initial date. And if you want to reference the active date, you need to use this.state.value.
Changed the state-change command to also update the this.state.date thingy, in the onchange event.
this.setState( { value: e, date: e } )
worked like a charm.

Not very technical on the JS lingo, but the thingy works… I’m not a fan of JS.

1 Like

Thanks @BoSen29 for sharing…I did have an attempt 11 days ago here:-
https://github.com/psDevUK/UD-DatePicker/tree/master/UniversalDashboard.DayPicker
But as mentioned cannot read the values back that have been selected…so although it looks nice, it is pretty useless at the moment until I can read the state value. Will look to see if I can fudge how you done it, or use the hook method Alon is now using. Just need to create a few more hours in the day now to make time for this :slight_smile:

Dude, don’t be a tease @psDevUK
Show me the un-compiled good stuff!

I tried Alon’s solution, however it seemed overly complicated for a single component. (and i couldn’t get it working)

Sorry @BoSen29 I do my development on my personal laptop and still stuck at work for another 1 hr and 19 minutes not that I am counting :roll_eyes: So I will upload you my JSX file, was mainly a big copy and paste of :- http://react-day-picker.js.org/examples/selected-range
Like I mentioned it works beautifully in UD, but I cannot read the selected dates…need to set some learning time aside for binding this to UD properly.

1 Like

@psDevUK feelbadman in uk time :open_mouth:
Hit me up :slight_smile:

1 Like

The hook make your component simple you dont need to deal with all the events from , get set sync add remove udelement , i try to make like a tutorial on the hook

1 Like

You can take a look on the feedback component that @psDevUK created its used the hook

I’ll give it another go on my next control :wink:
@psDevUK’s github is ususally my goto for inspiration

2 Likes

Boom @BoSen29 you got me inspired this time…now work settled down took some time to revisit the component I was working on as felt a bit :star_struck: by your comment…tried to live up to the hype :grin:

2 Likes

Lookin’ good bro!
Keep it flowing :slight_smile:

1 Like


bit spooky :ghost: we were both doing a calendar component without actually speaking to one another :rofl:

1 Like

Lookin good, i’ll give it a go tomorrow!
Should’ave discussed this in the lounge my dude :open_mouth:

Hey Guys,

this is a small favor but will be very helpful if it can be implemented with UD, will any of you be able to build the following react component

above one has a feature to select time as well which is very helpful in creating windows scheduled tasks based on date and time so it will be similar to the one you guys created but has the ability to pick a time as well.

Thanks in advance.

Hey @wsl2001 damn there is a lot of sub-dependencies on this…but your looking for a single date picker with a time as well?
I will look into this but working on some personal development at the moment

@psDevUK
you are right, am looking for not only a date pick but a time as well, this way you can use UD to create a windows task schedule with date a time to run Vs. relying on default time (12.00) that currently UDCalendar has.