# Working on a calendar link generator

**URL:** <https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133>\
**Category:** Ask for Help\
**Created:** [September 12, 2022, 10:11am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133 "2022-09-12T10:11:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 10:11am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/1 "2022-09-12T10:11:48Z")

</div>

Hi I’m working on a calendar link generator. Google / Microsoft and Yahoo have all different templates, to be able to fill those templates in the right way and be as flexible as possible (different order, different notation), I now let people pick From year / month / day / hour / minutes one by one and the same for To year / month etc. I’ve got the Google Calendar one working, so I’m happy with that ;-). And now ready for the rest. But … it feels stupid not to use the date and time component twice. Looks and feels better and simpler. Does anyone have experience with this? Should the Glide date and time notation work for all?

 ![CleanShot 2022-09-12 at 12.04.28@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/8/b8aca9a0c0fd05e3f5b2ef4126c9053d9c9ecb2c.png)  
 ![CleanShot 2022-09-12 at 12.14.01@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/3/c3e99d90880e347e5a13355be42bfe63628037cf.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2022, 10:26am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/2 "2022-09-12T10:26:07Z")

</div>

> [@erwblo](#):
>
> But … it feels stupid not to use the date and time component twice. Looks and feels better and simpler.

Maybe stupid is being a bit harsh on yourself, but it’s certainly a bit cumbersome the way you have it set up 😉

My advice would be to use date/time pickers, and then use computed columns to massage the date/time values into whatever format you need.

A very easy way to do that would be with the [Format Date](https://www.glideapps.com/plugins/format-date) plugin column - but beware that one is known to give inconsistent results with Safari on IOS. So I generally recommend against it.

A slightly more difficult - but more robust - option is to use a bit of Glide date math combined with a template.

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 10:55am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/3 "2022-09-12T10:55:33Z")

</div>

And even so I was proud of myself to have it working, haha! Will look into it further! It’s all part of the learning proces 🙂

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 11:33am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/4 "2022-09-12T11:33:42Z")

</div>

![CleanShot 2022-09-12 at 13.32.30@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/2/f2819e2ff1dcd8d0410c88079135ee719c5f859a.png)

@Darren_Murphy Could you give me a start direction? Where do I begin with computed columns to get the above to:  
20221002T110000/20221003T230000

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2022, 12:05pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/5 "2022-09-12T12:05:50Z")

</div>

You’ll need 5 columns.

For each of From & To, create 2 Math columns using the following formulas:

First, for the date:

```auto
Year(From)*10000
+ Month(From)*100
+ Day(From)

```

And then for the time:

```auto
Hour(From)*10000
+ Minute(From)*100
+ Second(From)

```

And then create a template column to join all 4 math columns together:

 ![Screen Shot 2022-09-12 at 8.04.00 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0fb8e2d1fc5dca8049ceac8693dec2b25cf81404.png)

The end result should look something like the following:

 ![Screen Shot 2022-09-12 at 8.04.42 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/9/c9f7cd00d79496fa7bcb2c8888ea6b35af690206.png)

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 12:07pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/6 "2022-09-12T12:07:21Z")

</div>

Thank you, this helps a lot, and in more ways than this specific situation! Thanks!

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 12:09pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/7 "2022-09-12T12:09:48Z")

</div>

One question to properly understand though: what is the logic behind:  
Year(From)\*10000

- Month(From)\*100
- Day(From)  
Why do it like this?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2022, 12:26pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/8 "2022-09-12T12:26:15Z")

</div>

Well, the idea with the math columns is to convert each of the dates and times into numbers that we can then use in the template to get the correct format.

Take the date as an example, if we just did:

```auto
Year(From)
+ Month(From)
+ Day(From)

```

…that would give us:

```auto
  2022 
+ 10 
+ 2 
= 2034

```

Which is of course not what we want.  
So multiplying the Year by 10,000 moves it 4 places to the left, and multiplying the Month by 100 moves it 2 places to the left.  
So we get :

```auto
  20220000 
+ 1000 
+ 2 
= 20221002

```

Which is the result we need.  
And the same logic applies to the Time bits.

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 12:46pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/9 "2022-09-12T12:46:17Z")

</div>

Understood, thanks!

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [September 12, 2022, 1:20pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/10 "2022-09-12T13:20:55Z")

</div>

> [@Darren\_Murphy](#):
>
> A very easy way to do that would be with the [Format Date](https://www.glideapps.com/plugins/format-date) plugin column - but beware that one is known to give inconsistent results with Safari on IOS. So I generally recommend against it.

Hola Darren,

May you give an example about this case? I have tested several times this Format Date plugin with different regional settings and formats (dd/mm/yyyy or yyyy/mm/dd) and so far, I haven’t found any problem by using it.

Of course, we need to be careful using this plugin if we want to compare or/and order dates chronologically, the plugin converts Date values to Text values so, if we want to have a right format to get right results, the correct format must be **yyyy/MM/dd** to avoid headaches.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f2cf1ea762b97ab3cacd57210bf5cbeab200e2f.png)

Gracias!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 12, 2022, 2:09pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/11 "2022-09-12T14:09:12Z")

</div>

Is there a reason we’re not using an event picker here? To allow people to pick from different days?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2022, 2:10pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/12 "2022-09-12T14:10:26Z")

</div>

Yes, good point.

@erwblo ☝

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2022, 2:13pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/13 "2022-09-12T14:13:37Z")

</div>

> [@gvalero](#):
>
> May you give an example about this case? I have tested several times this Format Date plugin with different regional settings and formats (dd/mm/yyyy or yyyy/mm/dd) and so far, I haven’t found any problem by using it.

I’m not sure that I can give an example, without doing a bunch of testing with different devices.  
Also, I haven’t used it for a long time, because every time I did I would find myself being bitten by it. So I just stopped using it. In fact, I don’t bother with any of the date related plugins. I just don’t trust them.

I can get the results I need with Glide Date Math, and I know that it works 100% of the time, so that’s good enough for me.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [September 12, 2022, 2:43pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/14 "2022-09-12T14:43:41Z")

</div>

Ok, I saw.

I think you need something like a faith jump 🤣

The Jeff’s trick is still bulletproof for these cases and I used it many times when I needed to sort a dates array. It never failed.

Saludos!

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 3:19pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/15 "2022-09-12T15:19:56Z")

</div>

To be honest I’ve never even looked at the event picker 😉 But I guess it must be better to do start and stop in one component 😉

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 3:34pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/16 "2022-09-12T15:34:48Z")

</div>

Looking at it … is this meant to be for people choosing an event based on a set set of events? In my case I build an app where an event organiser can add a new event, so without choosing from a set of events, it can be everything. @Darren_Murphy

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 12, 2022, 5:42pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/17 "2022-09-12T17:42:56Z")

</div>

Darren, soory to bother you again, getting there!  
I have this working for Google Calendar now, great!  
Outlook though, wants the start date and time look like this, how would you do that?

2022-10-22T11%3A00%3A00%2B00%3A00

Coming from  
 ![CleanShot 2022-09-12 at 20.19.30@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/2/d298f950acb59d93ddf323206d345e51a7a2ec8f.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2022, 10:31pm UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/18 "2022-09-12T22:31:28Z")

</div>

How picky is outlook about leading zeros? Will it accept 05 for a Day, or does it need to be 5?

There’s a few different ways to handle this situation.

- You could piece it apart and separate day, month, year, hour minute second. Then put it all back together with a template column. 13+ columns total. 🤮
- Or you can cheat a little bit with some creative math to cut the number of columns in half, and get a little more creative with a couple template columns. 🤮
- Or you could take the google style, and use some javascript to split and reformat the values (probably the cleanest). 🙂

But most importantly, it’s good to know if leading zeros are allowed or not by outlook for any number (day, month, hour, minute, second). It’s probably safe to assume that leading zeros are allowed, so javascript would probably be best.

This is what I would do…taking your existing google formatted dates and run them through some javascript. Something like below. I’m sure someone could clean it up a little bit. It’s not the most efficient, but it’s readable. (Javascript is not my first language)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/d/2db0e433dfd2dc87823a9d04b04023866c718378.png)

```auto
var Date = p1.split('T')[0];
var Time = p1.split('T')[1];

var FDate = Date.substring(0, 4) +
                     '-' +
                     Date.substring(4, 6) +
                     '-' +
                     Date.substring(6, 8);

var FTime = Time.substring(0, 2) +
                     ':' +
                     Time.substring(2, 4) +
                     ':' +
                     Time.substring(4, 6) +
                     '+00:00';

return encodeURIComponent(FDate + 'T' + FTime);

```

I wasn’t sure how to handle the last part. Looks like Outlook wants a ‘+00:00’ tagged onto the end. What does that represent? Is it a duration? A timezone offset? Something else? I wasn’t sure, so I just hardcoded ‘+00:00’ (which is the encoded version of %2B00%3A00) at the end. Also the last bit about encoding isn’t necessary, because the Construct URL column would take care of that anyway.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/9/898338f10224696b084cf60841ba0a44cbaca41d.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 13, 2022, 12:08am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/19 "2022-09-13T00:08:20Z")

</div>

What are you using for creating the links? Have you used [Agical.io](http://Agical.io)?

> [@Send google calendar invites](https://community.glideapps.com/t/send-google-calendar-invites/5658/19):
>
> Hi Jeff. I’ve had a good look at [Agical.io](http://Agical.io) and have managed to create a string to send to it based upon some fields in a simple app however the time it adds within the ical event is 1hr out. I’m assuming this is a timezone issue and british summer time thing? Here’s how my string looks at the moment. [http://ics.agical.io/?subject=12%20Main%20Street&organizer=My%20Jobs&reminder=15&location=12%20Main%20Street&dtstart=2020-06-25T14:00:00+00:00&duration=2H](http://ics.agical.io/?subject=12%20Main%20Street&organizer=My%20Jobs&reminder=15&location=12%20Main%20Street&dtstart=2020-06-25T14:00:00+00:00&duration=2H) Their website does have an example stri…

---

<div class="post-metadata">

**Author:** ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)\
**Post date:** [September 13, 2022, 6:24am UTC](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133/20 "2022-09-13T06:24:29Z")

</div>

Thanks a lot, I’m diving into this!

[Next page](https://community.glideapps.com/t/working-on-a-calendar-link-generator/49133.md?page=2)
