GithubHelp home page GithubHelp logo

al-codaio / events-from-gmail Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 2.0 33 KB

Create Google Calendar events from sending yourself a Gmail on a mobile device using Google Apps Script.

JavaScript 100.00%
gmail google-apps-script google-calendar

events-from-gmail's People

Contributors

al-codaio avatar bigjazzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bigjazzz 0xblurr

events-from-gmail's Issues

Not adding full message body

I've got the email set to a multi-line body, however it only grabs the first line. I would like to dump the entirety of the message body into the description for the event, but I'm unclear on how to make this happen. I've included a copy of the body below for reference. Any help would be greatly appreciated.

Name: Test Test
Email: [email protected]
Date/time: 21/11/2022 12:00
Phone: -
Suggested location: -
Notes: -

Not Sure what went wrong (TypeError: Cannot read properties of undefined (reading 'indexOf'))

I haven't touched coding since now but I followed this tutorial on how to scrape emails from gmail and make them calendar events to a tee and it spat out this error message, idk what to do

Error
TypeError: Cannot read properties of undefined (reading 'indexOf')
calcDateTime @ Code.gs:88
parseEmail @ Code.gs:38
getEmail @ Code.gs:23

EDIT: I'm pretty sure it's having trouble figuring out stuff with the date but that's the extent of my guessing....

Multiline Description

It would be nice to have multi-line descriptions. I often create doctors appointments with the Address +number, due to the fact I have to use a free disability transport and I need that info on hand when I make a pickup appointment with them. I can only make these pickup appointments 12 days in advanced(some of my appointments are more than a month out), so it would be nice to still have all that info in the description as I have been doing it manually.

parseDate function not receiving date correctly

Problem:
It seems to break when the parseDate(rawDate) function is called, the date gets passed down wrong. I have also switched it to US format to see if that would fix it and still no dice. I believe it's breaking right before that. Newish to this language and hitting wall, would appreciate your help. :)

Notes:
Subject line looks like this:
Patch Series, 23-4, 5 PM

I can't change the subject format from a - to a /
I replaced the var dateDetails = date.split("/") with var dateDetails = date.split("-")
Added some console.log trying to debug what's going on but running into date getting passed as just the day and not the dd-mm that we're looking for.

Execution log:
3:45:25 PM Notice Execution started
3:45:26 PM Info 23-4
3:45:26 PM Info 23
3:45:25 PM Error
TypeError: Cannot read property 'trim' of undefined
parseDate @ Code.gs:121
calcDateTime @ Code.gs:96
parseEmail @ Code.gs:38
getEmail @ Code.gs:23

calcDateTime(rawDate, rawTime, isAllDay) {
var dashModifierIndex = rawDate.indexOf("-")
var isMultiDay = dashModifierIndex == -1 ? false : true
console.log(rawDate)

// Get time if event is not an all-day event
if (isAllDay == false && isMultiDay == false) {
var [month, day, year] = parseDate(rawDate)
var [hours, minutes] = convertTime12to24(rawTime)
var newDateStart = new Date(year, month - 1, day, hours, minutes)
var newDateEnd = new Date(newDateStart)
newDateEnd.setMinutes(newDateStart.getMinutes() + DEFAULT_EVENT_TIME)
} else {
// Set start and end date if event is multi-day
if (isMultiDay) {
var startDate = rawDate.substring(0, dashModifierIndex)
var endDate = rawDate.substring(dashModifierIndex + 1, rawDate.length)
var [startMonth, startDay, startYear] = parseDate(startDate)
var [endMonth, endDay, endYear] = parseDate(endDate)
var newDateStart = new Date(startYear, startMonth - 1, startDay)
var newDateEnd = new Date(endYear, endMonth - 1, endDay)
isAllDay = true
} else {
var [month, day, year] = parseDate(rawDate)
var newDateStart = newDateEnd = new Date(year, month - 1, day)
}
}
return [newDateStart, newDateEnd, isAllDay]
}

// Get month, day, year from date with slash
function parseDate(date) {
console.log(date)
var dateDetails = date.split("-")

wrong zimezone

HI,

i have a issue with the script. I hope i did everything right. But still i got the error messages:

I got the wrong timezone

i am in timezone GTM+2

Event created was GTM-5


I have to add for the date the correct year (2022). if i write just "22" it will be 1922

my system:

OS: Linux
Browser: Chrome
Timezone: gtm +2, Checked in OS and Google calendar

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.