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
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.
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
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.
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
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 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.
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
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 by your comment…tried to live up to the hype
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.
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.