i want to create custom time slot in kendo day scheduler. For example i want to create the time slot of 15 min duration from 9:00 am to 1:00 pm and after that i want to create time slot of 30 minutes duration from 1:00 pm to 5:00 pm. i am getting time slots from DB and i want to create slots as it is as its coming from DB.how can i Override the default slot creation of kendo calendar.By defining "majorTick" i am getting all slots with same time duration but i want to customize this duration according to the time coming from DB with each row. Any suggestion/idea to achieve this functionality.
The Kendo Scheduler doesn't support this behavior at all.
If you'll make changes to the table element itself you'll probably break the scheduler's functionality.
A possible solution is this:
Set the major/minor tick size (according to your preference) to the smallest common denominator among all the slot sizes you got from the server.
Override all the move, moveEnd, resize, resizeEnd... events to cancel any changes if the change made didn't fit the "actual slot size" in that time.
Use e.preventDeafault(); to cancel the changes.
If you need further explanation, let me know.
Related
The Microsoft planner does not seem to support time for tasks, i.e. does not have any way to specify the time:
But when I am calling planner API to get task start date/time like this:
https://graph.microsoft.com/v1.0/planner/plans/xxxxxxxxxx/tasks
The API returns dates with time (and the time is not zero and not UTC-zero). In this example, it's 10:00. Where is this 10:00 coming from? May it be hardcoded in planner?! My local time when I created that task was 18:23
Basically, the question is, what is this time (may it be different in different organizations / teams)? Or more specifically, how do I get pure date (the date displayed by the planner itself) from that value? Removal of the time seems to be a wrong option? (the time may be overlapping to the next / previous day, depending on the time zone). In which time zone is the time, returned by the planner API? Why is it not zero (or UTC-zero), if planner supports only dates?
Planner stores the date picked in the UI as 10 AM UTC of the picked date. That specific value causes the Local time equivalent to be in the same date as most places. The recommendation for clients is to take the time value with it's offset (in cases Planner Web sets this, the offset will be 0, which is indicated by the Z suffix in your sample), and convert it to local time to display (just the date portion of the resulting value).
startDateTime is the property of type DateTimeOffset representing date and time at which the task starts. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
Refer documentation here.
Thanks.
I feel like I'm going round the houses on this one.
In summary, I have a Location model which has opening hours, modelled as opens_at and closes_at in the DB.
All times are stored as UTC in the database.
If I create a location in New York with opens_at set at 08:30 in my form and it gets saved to the DB as 08:30 UTC, why would I need to worry about timezones? I don't want to display the time in local time because the user would then see opening hours of 03:30.
Am I overthinking this? Do I only need to worry about timezones if I have users in multiple countries attending the same event at the same time?
As this is about physical locations, it feels to me that it wouldn't be needed.
If I create a location in New York with opens_at set at 08:30 in my form and it gets saved to the DB as 08:30 UTC, why would I need to worry about timezones?
Because 08:30 in New York is not 08:30 UTC. It's not even the same time for all dates.
It's 13:30 UTC when New York is observing Eastern Standard Time (EST, UTC-5)
It's 12:30 UTC when New York is observing Eastern Daylight Time (EDT, UTC-4)
So, if the location opens at the same time every day, then you must store it in local time. Otherwise you'll be off by an hour one way or the other following the next DST transition.
This can be an issue even for time zones that don't use DST, and even for non-recurring events, because the various governments of the world control the time zones within their borders. They can change whether to start observing DST or stop observing it, the dates and times that DST transitions occur, or their standard offset from UTC. Some give adequate notice when they make such changes, and others do not. There's always some non-zero chance that a given time zone might change its behavior between when you initially recorded the event and when the event takes place. If you recorded using local time, all you need to do is update the time zone data on your systems (which often happens automatically). However, if you recorded the event using UTC then you could be off when converting back after such a change.
In general, future events should always be stored in terms that the event is described - which is almost always in local time of some particular time zone. Store the IANA time zone ID (e.g., "America/New_York") with the location or event so that you can convert when you need to, but converting to UTC prematurely can lead to losing sight of the original information.
Save the "Always UTC" mindset for past or present events, such as timestamping a transaction.
Yes, I actually have run into this. If the user is only going to see the time in the local time zone, then it is not really necessary to save in UTC with time zone. You can save it in local time without time zone.
Reference: Postgres Time without Time Zone
Some developers will say that you should save it in UTC with the time zone, but I can see two arguments against it:
If you don't need it now and you may never need it.
You may not have access to the Time Zone now or may need extra code/complexity to implement and validate.
You can probably add it later if you know the time zone or lat/lon or address.
I have a series of events ranging from 1 to 8 hours that are tagged with a name over the last 2 years. Using the templating function I can move display the different events. My problem is that the time range doesn't rescale when i want to display an event that is outside the currently displayed time range. Ideally I would like to dynamically set the URL with the timestamp encoded from the max and min time of the database (influxdb) query. Any ideas on what I can do?
Here is a screenshot of my problem
I know that I can get browser timezone name: moment.tz.guess()
How can I guess timezone for custom date? e.g. moment("2020-12-30T14:17:40+11:00").tz.guess() ?
You can't. There are 9 different location-based zones that use +11:00 year round, and 5 more that use it for daylight saving time.
You might be able to eliminate a few if the date and time put it into a time zone where daylight time is not in effect and the standard time doesn't match, but from there, the best you could do would be to pick one at random.
See "time zone != offset" in the timezone tag wiki.
Moment-timezone can guess the browser's time zone because it can query the offset for multiple different timestamps, algorithmically reducing the possibilities. Even then, there are often several that could match, and thus the most likely one is picked (based on population statistics). In the end, it's still a guess.
I have a event activity that I want to put on calendar. activity has a start date, an end date, and 7 different times for every weekday. Now I want to set up the calendar so that activity appears at the right time for each day during the week (which are all different) from start date to end date. However, it seems that initRecurrenceWithFrequency:interval:daysOfTheWeek:daysOfTheMonth:monthsOfTheYear:weeksOfTheYear:daysOfTheYear:setPositions:end: does not allow me to specify at what time the activity occurs everyday.
How should I accomplish this?
You can only create repeating events at regular intervals. In order for you to create events at different times, you need to create multiple events.