Comments (31)
Looks like that when we "Add to Dialogflow", it imports an old/wrong version of the code. See line 53:
const dateTimeStart = new Date(Date.parse(agent.parameters.date + 'T' + agent.parameters.time + timeZoneOffset));
I don't know if this is new in the V2 update, but both @sys.date
and @sys.time
return complete ISO representations, so it kinda messes the concatenation inside the Date.parse() method.
The correct way can be found on the repository code.
const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1].split('-')[0] + timeZoneOffset));
Try replacing line 53 in the inline editor with the correct code (or replace the entire index.js, if you'd like to be extra sure).
from fulfillment-bike-shop-nodejs.
Click on setting in dialogflow then change API version to V1 API this will slove ur. Problem
from fulfillment-bike-shop-nodejs.
me too
from fulfillment-bike-shop-nodejs.
Make these changes in index.js
const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1].split('-')[0] + timeZoneOffset));
And then change Api version to v1 API
Hope this will solve ur problem.
But main problem what I face it won't update anything to Google calendar if we change the API version
from fulfillment-bike-shop-nodejs.
already change to const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1].split('-')[0] + timeZoneOffset));
but still invalid date
from fulfillment-bike-shop-nodejs.
yes, but like u said "But main problem what I face it won't update anything to Google calendar if we change the API version", i've that problem too, cant update my calendar @muneebf20
from fulfillment-bike-shop-nodejs.
muneebf20 Ieven after removing +timeZoneOffset it is still not working. It parses the date alright, but doesn't add the event to calendar. Is it working by you?
from fulfillment-bike-shop-nodejs.
Yeah working fine can u send ss of your firebase log so I will came to know what actually the problem is
from fulfillment-bike-shop-nodejs.
I suggest you go to Google.com/clander check there I think it need some time to get updated in clander app so check it online.
from fulfillment-bike-shop-nodejs.
https://calendar.google.com/calendar/
To update in app it need sometime so check online ...
Hope this will fix ur problem
from fulfillment-bike-shop-nodejs.
@muneebf20 the logs say that the webhook execution was successful, returning 200 status code and everything, but the agent just replies that there are no available slots for this date. Note that it is parsing the date correctly. it just says no slots available which is a fallback message for makeAppointment function so I think it is failing in createCalendarEvent function.
And yes I have checked by going to the calendar itself, and nothing is happening.
from fulfillment-bike-shop-nodejs.
Then I suggest to configure the calendar settings again since it praising the data correctly then I think its problem with calendar setting
from fulfillment-bike-shop-nodejs.
Make sure while creating calendar the event like bikshop in calendar u give the permission to it to read/write what ever b required
from fulfillment-bike-shop-nodejs.
@muneebf20 my configuration is right and all the permissions in place. thanks anyway!
from fulfillment-bike-shop-nodejs.
In my case it's working fine
Code is modified....
I don't knw what problem actually u are facing try to send ss
If possible for that I will try to help u to figure out problem
from fulfillment-bike-shop-nodejs.
It worked, I just scrapped that code and pasted again. May be any small typo somewhere.
Thanks @muneebf20 for your help.
from fulfillment-bike-shop-nodejs.
@AndrewLian97 What is in firebase log . Are u getting any kind of error in log.
from fulfillment-bike-shop-nodejs.
First try to add some billing account , then check wether it will work . If not we will try to fix it .
from fulfillment-bike-shop-nodejs.
Well billing account is in Google cloud account which is associated with your dialogflow , even though its not mandatory but sometime it can cause errors. This portion can b ignored . Can u send ur code so i can check that .
from fulfillment-bike-shop-nodejs.
Did u provide your calendar id and serviceAccount properly
from fulfillment-bike-shop-nodejs.
What i m seeing there is no calendar id and serviceAccount mentioned in your code.
from fulfillment-bike-shop-nodejs.
Change timeZone = ' Asia/Colombo ';
Then try if this not work let me know.
from fulfillment-bike-shop-nodejs.
https://calendar.google.com/calendar/
Open this link in your browser to check whether any slot is created or not
from fulfillment-bike-shop-nodejs.
Try with by changing the package with this code
{ "name": "dialogflowFirebaseFulfillment", "description": "Dialogflow fulfillment for the bike shop sample", "version": "0.0.1", "private": true, "license": "Apache Version 2.0", "author": "Google Inc.", "engines": { "node": "~4.2" }, "scripts": { "lint": "semistandard --fix \"**/*.js\"", "start": "firebase deploy --only functions", "deploy": "firebase deploy --only functions" }, "dependencies": { "firebase-functions": "^0.6.2", "firebase-admin": "^5.2.1", "googleapis": "27.0.0", "dialogflow-fulfillment": "^0.4.1", "actions-on-google": "^2.1.3" } }
from fulfillment-bike-shop-nodejs.
Oo o
from fulfillment-bike-shop-nodejs.
I won't b available tmrw. The problem is u r not passing the event in then(({event}) and in last
resolve({event:event});
Hope this will solve ur problem if u still face the problem in your code and u need to b done this project as important then drop ur email i will send u my own code which will work definitely. That too only if ur. Student 😂
All the best
Happy coding.
from fulfillment-bike-shop-nodejs.
Hi guys, I don't know if this is still going to help anyone. Battled with the same issue for 2 days and it finally worked today. So in stripping the dates, I had to strip a + instead of a - since my time formats have a + since I'm in South Africa. This solved the 'invalid date' part but it still didn't insert in the calendar. Then I realised that in calendar permissions I had to change the permissions for the email that we get from the json file to "make changes to events". Then it worked. so I think the issues might be in google calendar where you have to give the client email the right permissions
from fulfillment-bike-shop-nodejs.
from fulfillment-bike-shop-nodejs.
Hi, I change "-" to "+" for Europe time zone and it works fine without errors but nothing write to my calendar. When I see logs then:
dialogflowFirebaseFulfillment | Parameters { time: [ '2019-11-15T22:00:00+02:00', '2019-11-16T00:00:00+02:00' ], date: [ '2019-11-16T12:00:00+02:00' ], process: [ 'test' ], name: [ 'test' ], phone: [ '49067567889' ] } | |
---|---|---|
dialogflowFirebaseFulfillment | TypeError: agent.parameters.date.split is not a function at makeAppointment (/srv/index.js:58:70) at WebhookClient.handleRequest (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:303:44) at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/srv/index.js:75:10) at cloudFunction (/srv/node_modules/firebase-functions/lib/providers/https.js:57:9) at /worker/worker.js:783:7 at /worker/worker.js:766:11 at _combinedTickCallback (internal/process/next_tick.js:132:7) at process._tickDomainCallback (internal/process/next_tick.js:219:9) | |
-- | -- | |
dialogflowFirebaseFulfillment | Function execution took 108 ms, finished with status: 'crash' | |
-- | -- |
What`s wrong? Can anybody help me?
from fulfillment-bike-shop-nodejs.
from fulfillment-bike-shop-nodejs.
I am in Singapore, changed my timezone to Singapore and double-checked the Calendar permissions to "make changes to events". Still, the calendar is not updated. Struggling for two days. Kindly help, please.
from fulfillment-bike-shop-nodejs.
Related Issues (12)
- No appointment created in google calendar HOT 28
- Error : Initializing firebase-admin may fail HOT 1
- "TypeError: Cannot read property 'split' of undefined at convertTimestampToDate" and other such annoyances
- Appointment is not showing on my Calendaer
- Error creating agent
- Invalid date
- TypeError: Cannot read property 'source' of undefined HOT 5
- No appointment created! HOT 10
- Error in creating agent HOT 2
- Issue with Calender HOT 2
- Invalid date HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fulfillment-bike-shop-nodejs.