All-day events not showing in scheduler in day views - fullcalendar

I'm trying to show organizational events, such as holidays, on the calendar in addition to scheduled events such as meetings. I'm showing five scheduler / calendar view options: timelineWeek,agendaDay,agendaTwoDay,agendaWeek,month
In 'agendaWeek' and 'month' views, these all-day events show, both when resource ID is not specified and when the event is tied to all resources IDs through an array:
However, on the 'timelineWeek', 'agendaDay', and 'agendaTwoDay' views, these "allDay" events will not show. The events are injected through AJAX which returns:
[
{
"id": "1000001",
"resourceIds": "['16121','14174','14175','14842','14843','14844']",
"start": "2017-01-27T00:00Z",
"end": "2017-01-27T00:00Z",
"allDay": true,
"title": "ResourceIDs Array Day",
"eventStatus": null,
"borderColor": "#FF0000",
"backgroundColor": "#F9626B"
},
{
"id": "1000001",
"start": "2017-01-27T00:00Z",
"end": "2017-01-28T00:00Z",
"allDay": true,
"title": "ResourceID Null Day",
"eventStatus": null,
"borderColor": "#FF0000",
"backgroundColor": "#F9626B"
}
]
Is it possible to show all-day events on the scheduler?

Like most of my problems, this issue was caused by my own mistake. The list of resource IDs in the JSON was malformed (a string, not an array).
Bad, fails:
"resourceIds": "['16121','14174','14175','14842','14843','14844']",
Better, works:
"resourceIds": ['16121','14174','14175','14842','14843','14844'],

Related

How can we differentiate between a secondary and shared calendar in Google Calendar API response

I have a query with respect to the Calendar List API for Google Calendar:
https://developers.google.com/calendar/api/v3/reference/calendarList/list
We have a scenario where user1 has shared his calendar with user2 with Make Changes and Manage Sharing permission.
Now if we invoke the list calendar API on user2, we receive a response as below:
{
"kind": "calendar#calendarListEntry",
"etag": "\"<redacted>\"",
"id": "user1#gmail.com",
"summary": "user1#gmail.com",
"timeZone": "Asia/Kolkata",
"colorId": "4",
"backgroundColor": "#fa573c",
"foregroundColor": "#000000",
"accessRole": "owner",
"defaultReminders": [],
"conferenceProperties": {
"allowedConferenceSolutionTypes": [
"hangoutsMeet"
]
}
}
We can see that the access role above for the user1's calendar is owner and the primary value is absent(false).
Now if user2 has a secondary calendar we again see something similar in the listcalendar API response:
{
"kind": "calendar#calendarListEntry",
"etag": "\"<redacted>\"",
"id": "<redacted>#group.calendar.google.com",
"summary": "Secondary Calendar",
"timeZone": "Asia/Kolkata",
"colorId": "1",
"backgroundColor": "#ac725e",
"foregroundColor": "#000000",
"selected": true,
"accessRole": "owner",
"defaultReminders": [],
"conferenceProperties": {
"allowedConferenceSolutionTypes": [
"hangoutsMeet"
]
}
}
Access role above for the secondary calendar is owner and the primary value is absent(false).
So how can we differentiate between a secondary and shared calendar for user2? We require the same for some specific processing in our application.
As discussed in the comments there does not seem to be a clear way to differentiate the secondary calendars, except for the id and the appearance of the primary field.
Without having a database to control it, it does not seem to be possible to differentiate between a secondary calendar and a shared calendar, except for the calendar id.
You can use this template to explain your case to Google and ask to always have a field where you specify the calendar owner or another element that allows you to identify it.

Wrong date of recurring events are added in google calendar

When I add an recurring event from one timezone, the UNTIL date shows correctly but the events shown are wrong
For example,
{
"end":
{ "dateTime": "2017-09-26T22:10:00", "timeZone": "America/New_York" },
"start":
{ "dateTime": "2017-09-26T21:50:00", "timeZone": "America/New_York" },
"recurrence": [ "RRULE:FREQ=DAILY;UNTIL=20170929;" ],
"summary": "LEAVE. ",
"location": "New Tover"
}
When I add this, it shows till 28 only but not till 29.
If I set it as a day extra, it takes my offset value of timezone and recurring event differs while adding.
For example, if my timezone is Asia/Culcutta, and if i add a recurring event anytime between morning 12am-5:30am, it shows till 30th and other events till 29th. Please help.

structure data for different queries

I am learning firebase and trying to find the best way to structure my data.
Use an example of a simple leave application. Employees can submit and view their leaves. Managers can approve leaves.
Option 1
"leaves": [
{
"employee": "pCIUfttSrXQ1dLPDwH7j9GExCkA2",
"date": "2017-03-01",
"status": "pendingApproval",
},
{
"employee": "YSJCAe4wZdYCplA3e0ejMqzQmEF3",
"date": "2017-01-01",
"status": "approved"
}]
With option 1, filtering will be required in both cases:
When employee lists his leave history (filter by "employee")
When manager lists all the pending leaves (filter by "status=pending")
Option 2
"leaves":
{
"pCIUfttSrXQ1dLPDwH7j9GExCkA2" : [
{
"date": "2017-03-01",
"status": "pendingApproval"
}
],
"YSJCAe4wZdYCplA3e0ejMqzQmEF3" : [
{
"date": "2017-01-01",
"status": "approved"
}
]
}
With option 2, no filtering is required when employee lists his leave history, but filtering is required (and I don't know how) for manager to list pending leaves.
What should be the right way to structure the data? And if it's option 2, how would we filter the pending leaves for all employees?
Use the second option;
For the manager to filter through the pending queries , use:
FIRDatabase.database().reference().child("leaves").queryOrdered(byChild: "status").queryEqual(toValue: "pending").observeSingleEvent(of: .value, with: {(Snapshot) in
print(Snapshot.value!)
// If you have multiple pending request you gotta loop through them
// using for loop, access them as separate entity and operate on them
})

FHIR Medication Administration - Current Dose

I need a way of saying where we are currently within a dose of medication.
Like 5 execution out of 7
or Dose Administration number 5
Does anyone know how to express this in the event objects or elsewhere?
Have you checked the MedicationAdministration resource? It has a 'note' field where you could put this in, and also a text field for the dosage.
I put in a change ticket for this functionality within FHIR, but for now I am saving it in Medical Administration Event History:
But I have to extend action to have quantity.
http://hl7.org/fhir/medicationadministration.html
"medicationAdministration":{
"eventHistory":[{
"action":{
"coding": [{
"system": "http://www.kindred.com/proTouch",
"code": "lastDelivery",
"display": "Last Delivery"
}],
"dateTime":"2016-09-22 13:06:20"
}
},{
"action":{
"coding": [{
"system": "http://www.kindred.com/proTouch",
"code": "dosesAdministered",
"display": "Doses Administered"
}]
"quantity":2
}
}]
}

Pre-processing Redux state (location for business logic)

I have created an application in react, which has the purpose to find flights and display them in a results window. With filter settings in the sidebar, you are able to filter these results. Currently I am converting the react app to Redux.
I have the following state in my store:
const defaultState = {
flightOffers,
filteredFlightOffers,
filters
}
Where flightOffers is an array of objects with flightresults:
flightOffers = [{
"inboundFlight": {
"departureDate": "2016-06-02",
"departureTime": "09:00",
"departureTimeSpan": "morning",
"arrivalDate": "2016-06-02",
"arrivalTime": "12:32",
"arrivalTimeSpan": "afternoon",
"marketingAirline": {
"companyShortName": "KL",
"name": KLM,
"imageurl": "images/logos/kl.png"
},
"flightNumber": 5131,
"departureAirport": {
"locationCode": "BCN",
"name": "Barcelona"
},
"arrivalAirport": {
"locationCode": "AMS",
"name": "Amsterdam"
}},
];
The state of filteredFlightOffers is the same, but a subset of the flightOffers state object.
And the filters state object has the following format:
filters = [{
"type": "airlines",
"checked": true,
"label": "Air France",
"count": 579
},
{
"type": "airlines",
"checked": true,
"label": "Brittish Airways",
"count": 554
},
{
"type": "airlines",
"checked": true,
"label": "CityJet",
"count": 576
}
];
The flightOffers state object is retrieved by an API call.
The filteredFlightOffers state object should be created based on all the checked / non-checked items in the filters state object, and should be recreated every time a filter is changed.
The filter stateobject will have a changed checked value every time an item is clicked, but also updated count items for all elements every time the new filteredFlightOffers state object is recreated.
Now I have the following questions:
My filters state object is derived from the flightOffers state object and should be created on the fly when the data from the flightOffers is retreived by the API call. Where in the redux pattern is the good place to implement this logic?
I have a dispatcher for my flightOffers state and for my settings state. When a filter setting is clicked, an action will go to the filter dispatcher and return the new filter state. But how can I calculate all the new filter counts based on the flightOffer state? e.g. Do I need to fire a FlightOfferCounter action and give the filter state as input parameter? If so, can I fire this call from my filter reducer? Or do I have to create a FlightOfferCounter reducer which listenes to the same action as the filter reducer? Problem then would be that these reducers cannot be executed in parallel since the flightOfferCounter is based on the checked values in the filter state.
I am reading things about redux thunk (for implementing business logic). Is that something I need here?
Hope my questions are a bit clear.

Resources