Skip to content

Arty2/aircalendar

Repository files navigation

/aircalendar

A card based calendar, powered by an Airtable. It includes helpful details such as countdowns, Google Calendar links, auto-magical sorting. See the demo at https://arty2.github.io/aircalendar/

This script and its related Airtable base may change breaking compatibility. Designed with multilingual websites (i18n) in mind. Underlying code is quickly hacked together, but fully functional and should work even with missing fields.

Plug in a specific Airtable view and make use of it’s filters. In the example provided, events are sorted with the following formula, that gives priority to events that end soon, and moves upcoming events to the top, even if they haven’t started yet.

IF( NOW() < {end},
    DATETIME_DIFF( NOW(), {end} ),
    IF( {end},
        IF( NOW() < DATEADD( {end}, 1, 'days'),
            -2,
            -1
        ),
        IF( NOW() < {start},
            DATETIME_FORMAT( {start}, 'x' ),
            IF( {end-unknown},
                DATETIME_DIFF( NOW(), DATEADD( NOW(), 3, 'days' ) ),
                -1)
        )
    )
)

⚠️ This is not a plug & play solution. Requires jQuery, airtable.browser.js and a modified version of date.format.js (included). WARNING: By using your key in this script, you allow anyone to view (or edit) your base! Make sure your API (thus user) has read-only access!

To-do

  • Better settings
  • Translatable event summary
  • Translatable tags
  • Manual text override for dates (e.g. “Next Week”, “Up next”)
  • Autoupdating upcoming field
  • Reccuring events
  • Handling of connection errors

Credits

© 2019 Heracles Papatheodorou a.k.a @Arty2, MIT Licence

About

A card based calendar, powered by an Airtable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published