Code Monkey home page Code Monkey logo

Comments (31)

giorigor avatar giorigor commented on August 16, 2024 1

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.

muneebf20 avatar muneebf20 commented on August 16, 2024 1

Click on setting in dialogflow then change API version to V1 API this will slove ur. Problem

from fulfillment-bike-shop-nodejs.

georgetulloch avatar georgetulloch commented on August 16, 2024

me too

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

pandikapinata avatar pandikapinata commented on August 16, 2024

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.

pandikapinata avatar pandikapinata commented on August 16, 2024

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.

nqcm avatar nqcm commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

nqcm avatar nqcm commented on August 16, 2024

@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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

nqcm avatar nqcm commented on August 16, 2024

@muneebf20 my configuration is right and all the permissions in place. thanks anyway!

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

img_20180609_151500
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.

nqcm avatar nqcm commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

@AndrewLian97 What is in firebase log . Are u getting any kind of error in log.

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

Did u provide your calendar id and serviceAccount properly

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

What i m seeing there is no calendar id and serviceAccount mentioned in your code.

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

Change timeZone = ' Asia/Colombo ';
Then try if this not work let me know.

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

muneebf20 avatar muneebf20 commented on August 16, 2024

Oo o

from fulfillment-bike-shop-nodejs.

muneebf20 avatar muneebf20 commented on August 16, 2024

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.

Tsitsi-Primrose avatar Tsitsi-Primrose commented on August 16, 2024

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.

Tsitsi-Primrose avatar Tsitsi-Primrose commented on August 16, 2024

from fulfillment-bike-shop-nodejs.

uaway avatar uaway commented on August 16, 2024

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.

Tsitsi-Primrose avatar Tsitsi-Primrose commented on August 16, 2024

from fulfillment-bike-shop-nodejs.

chamsamalini avatar chamsamalini commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.