Fullcalendar time issue - salesforce

I am using fullcalendar in Salesforce.
There is this custom form created in salesforce in which user enter date and time in custom field which further creates a event in calendar on the specified date from form.
The issue is when I create event using agendaweek it saves the record using form for the specified date and time but when switching to month view and on manually adding the time it saves the event in calendar 5:30 hours behind.
I consoled output
End_Date_time__c":"2021-05-10T06:30:00.000Z","Start_Date_time__c":"2021-05-10T05:30:00.000Z"
I tried solving this issue by changing the timzone using following line which allows me to save as per the requirement but it changes the timezone of agendaweek making it 5:30 hours ahead because of the below specified line.
josnArr[i].start = new Date(josnArr[i].start).toLocaleString(undefined, {timeZone: 'Asia/Kolkata'});
If anyone could please suggest something.This is the form which I have used to create records in calendar.

Related

React JS DateTimePicker issue - Changing the time 12:01pm and 1:59pm - updated into next date

There is issue on DateTimePicker and DatePicker.
I am trying to modify the time as 12:10pm or 12:20pm in the DateTimePicker drop down, but it is changing the date as next day.
Example :- If the date is 12-Mar-2021, After modification in time drop down as 12:10PM, then the original date has changed to 13-Mar-2021.
It happens when only when i change the time as custom one, not happen with pre-defined drop down list example:- 12:30pm, 1:00pm.
I tried with all this solutions:-
https://github.com/Hacker0x01/react-datepicker/issues/1018

How to create ssr in reactjs

I'm trying to code a date picker using ReactJS but I don't know how to create a dynamic table that displays the actual month days every time I hit previous or next buttons. Here's my code: // Next step I need to add a matrix of weekdays (1..31) and check each month existing ...
I wouldn't reinvent a wheel unless it's unavoidable.
There are multiple date pickers that can be used out of the box:
E.g.:
https://www.npmjs.com/package/react-date-picker
https://www.npmjs.com/package/react-datepicker
https://react-day-picker.js.org/
But that's only if you just need any picker. If you must create a custom one, then this doesn't help.

mattlewis92/angular-bootstrap-calendar calculating Wrong Dates on different Timezone

I am using this calendar https://github.com/mattlewis92/angular-bootstrap-calendar for showing events and time slots for people all over the world. During sign up, every user has to set his timezone and then my application uses this timezone for further date computation rather than client machine timezone.
The problem is that when I make user timezone default using moment.tz.setDefault(timezone) and change the machine's timezone, the calendar calculates dates wrongly.
Here is my excerpt of my code:
moment.tz.setDefault($rootScope.timezone)
vm.calendarView = 'month';
vm.viewDate = moment().startOf('month').toDate();
vm.cellIsOpen = true;
Attached is the screenshot:
[Screenshot]
You can see that user's timezone is currently Asia/Karachi +5 and my machine's timezone is Beijing +8. Today's date is 8 September and the day is Friday, but on the calendar 8 September is showing as a Saturday instead of Friday.
mwl-calander did not provide support for timezone, you can use full calander
https://fullcalendar.io/
Demo https://fullcalendar.io/js/fullcalendar-2.9.1/demos/timezones.html
Its angular directive can be found at
https://github.com/angular-ui/ui-calendar
It would appear that this particular UI control does not support selecting a time zone. Simply using moment.tz.setDefault is not good enough, because everything the control is doing both internally and in its external API is using Date objects, which cannot represent arbitrary time zones. In other words, the author of that control would have to remove all .toDate() calls and use Moment objects as the primitive in the control instead of Date objects. That would be a breaking change for them.
I suggest filing an issue in that project's GitHub repository, and reference this page.

Arshaw full calendar does not show time properly

I am using Arshaw full calendar[Angular bootstrap] in my project, but after implementing it, Whenever I go to the day view and click on the time span say 12.00am, day click event gets fired and if I extract date from the view object I get the same date but the timing shows 05.30.0, That means there is difference of 5.30 hours... Why is this happening, I am using the latest version of master calendar. I am sharing the snapshot of the same. Please help, Thank you..!!!

Google Calendar API - List Event with startDate and EndDate Filter

I can't understand how Google Calender Event List work with timeMin and timeMax parameter.I am using the following statement for filter events. (Used Google Calender V3 API)
service.events().list(calendarId='primary',timeMin=start_dt,timeMax=end_dt)
I have created event from 23-12-2013 to 26-12-2013 without specifying time.
Now when I specified timeMax=2013-12-23T00:00:00+05:30 and timeMin=2013-12-23T00:00:00+05:30 then and only then I have got event in list if I specified timeMin greater than 23 it gives me event['items']=[]. Also not understand timezone.
Can anyone help me to understand this.

Resources