Successfully reported this slideshow.
Your SlideShare is downloading. ×

Recurring Dates in Drupal - BADCAMP 2020

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 39 Ad
Advertisement

More Related Content

Similar to Recurring Dates in Drupal - BADCAMP 2020 (20)

Advertisement

Recently uploaded (20)

Recurring Dates in Drupal - BADCAMP 2020

  1. 1. 111 RECURRING DATES A smarter approach in Drupal
  2. 2. 2 MARTIN @mandclu ANDERSON-CLUTZ
  3. 3. DEMO! 3 - Fresh install on Drupal 9
  4. 4. BASE INSTALL 4 > composer create-project drupal/recommended-project drupal9 > cd drupal9 > composer require drush/drush > drush site:install
  5. 5. "FANCY" INSTALL 5 > composer create-project drupal/recommended-project drupal9 > cd drupal9 > composer require drush/drush drupal/admin_toolbar drupal/gin drupal/gin_toolbar drupal/olivero > drush site:install > drush en admin_toolbar admin_toolbar_tools gin_toolbar > drush theme:enable olivero gin > drush config:set system.theme default olivero -y > drush config:set system.theme admin gin -y
  6. 6. ONE COMMAND INSTALL 6 > composer create-project drupal/recommended-project drupal9 && cd drupal9 && composer require drush/drush drupal/admin_toolbar drupal/gin drupal/gin_toolbar drupal/olivero && drush site:install --account-pass=[admin-password] --db-url=mysql://[db-user]:[db-password]@127.0.0.1:3306/[db-nam e] --site-name="Drupal 9 Demo" -y && drush en admin_toolbar admin_toolbar_tools gin_toolbar && drush theme:enable olivero gin && drush config:set system.theme default olivero -y && drush config:set system.theme admin gin -y && drush config:set gin.settings classic_toolbar 1 -y && drush config:set olivero.settings debug 0 -y
  7. 7. SMART DATE CALENDAR KIT 7 > composer require drupal/smart_date_calendar_kit > drush en smart_date_calendar_kit smart_date_recur
  8. 8. RECURRING EVENTS 8
  9. 9. RECURRING EVENTS 9 - A common use case - Though there are interface differences, calendar apps are largely consistent in the functionality they offer - Many apps use the RRULE format for or storage and/or import/export
  10. 10. THE GOLDEN RRULE 10 - A standard data model for describing recurring dates - Used by popular calendar apps, including Google and Apple - FREQ: YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, or SECONDLY - Limit: COUNT or UNTIL - INTERVAL - Complex structures: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, BYHOUR, BYMINUTE, BYSECOND, BYSETPOS
  11. 11. RRULE EXAMPLES 11 - DTSTART;TZID=America/New_York:20201013T100000 RRULE:FREQ=WEEKLY;UNTIL=20201231T235900;INTERVAL=2; WKST=MO - Every other Tue at 10am EST until Dec 31, 2020 - RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=5,6,7,8,9,10,1 1 - Friday of the first full week of the month
  12. 12. THE GOLDEN RRULE 12 Note 1: Limit if BYMONTHDAY is present; otherwise, special expand for MONTHLY. Note 2: Limit if BYYEARDAY or BYMONTHDAY is present; otherwise, special expand for WEEKLY if BYWEEKNO present; otherwise, special expand for MONTHLY if BYMONTH present; otherwise, special expand for YEARLY. SECONDLY MINUTELY HOURLY DAILY WEEKLY MONTHLY YEARLY BYMONTH Limit Limit Limit Limit Limit Limit Expand BYWEEKNO N/A N/A N/A N/A N/A N/A Expand BYYEARDAY Limit Limit Limit N/A N/A N/A Expand BYMONTHDAY Limit Limit Limit Limit N/A Expand Expand BYDAY Limit Limit Limit Limit Expand Note 1 Note 2 BYHOUR Limit Limit Limit Expand Expand Expand Expand BYMINUTE Limit Limit Expand Expand Expand Expand Expand BYSECOND Limit Expand Expand Expand Expand Expand Expand BYSETPOS Limit Limit Limit Limit Limit Limit Limit
  13. 13. HOW DEEP THE RABBIT HOLE GOES 13
  14. 14. STOP THE COMPLEXITY 14
  15. 15. 15 SMART DATE
  16. 16. UI COMPARISON 16
  17. 17. - Simplified date entry - “All Day” checkbox - More natural output for date ranges EDITOR EXPERIENCE 17
  18. 18. - Crawling a site about to launch, realized the slowest page was an events archive PERFORMANCE ISSUE 18
  19. 19. NEED FOR A MODULE 19 Editor UX Performance Formatting
  20. 20. 20 APPROACH
  21. 21. LEVERAGE CORE 21 - Extend core Date Range field - Uses an HTML5 datetime picker - Store data as timestamps - Native db Datetime has advantages, but 100% custom - Also not as portable - Postgres uses timestamps to store dates - Use existing class and methods - JS uses timestamps for internal storage too
  22. 22. RECURRING DATES 22 - Stores recurring instances as normal field deltas, so views will work like normal multivalued fields - Able to override specific instances - Reschedule or cancel - Special formatters for recurring dates - Show a specific number of upcoming and/or past instances - Able to customize text display of recurrence rule
  23. 23. CALENDAR INTEGRATION 23 - Originally a patch on Fullcalendar View - Now a plugin instance - Drag-and-drop support - Double-click to add events - Full support for recurring dates
  24. 24. STARTER KITS 24 - Bundles of configuration to get you up and running quickly - Install an Event content type and related views - A great way to try out Smart Date, or jump start your project - Easiest way to use Smart Date with Fullcalendar View - Patches welcome!
  25. 25. SMART DATE CALENDAR KIT 25 > composer require drupal/smart_date_calendar_kit > drush en smart_date_calendar_kit smart_date_recur
  26. 26. DEMO TIME! 26 - Editor - Field config - Display config - Smart Date formats - Timezones
  27. 27. MORE DEMOS! 27 - Enable smart_date_recur - Recurring Dates - Formatter - Make one! - Calendar
  28. 28. SMART DATE - MORE OPTIONS! 28 > composer require drupal/smart_date:^3.1.0 > drush updb > New recur options > Make another event
  29. 29. 29 OTHER MODULES
  30. 30. RECURRING DATES FIELD 30 - AKA date_recur - The goto solution in Drupal 7 - RRULE field, instances generated - No UI out of the box - Companion module offers options - Views require relationship to show instances - Some calendars require patches
  31. 31. SMART DATE 31 - Primary design goal was ease of use - Takes cues popular calendar software - Recurring dates added as a submodule - Instances stored as field deltas, reference rule - Uses RRULEs internally - Calendar integration out of the box - Drag-and-drop editing, creation
  32. 32. RECURRING EVENTS 32 - Doesn't use RRULE internally - Submodule for registration - Not a field, custom entities - UI is deliberately unstyled - a blank canvas! - "Consecutive" recurring dates - No timezone handling
  33. 33. BOOKABLE CALENDAR 33 - Uses the Smart Date interface - Built for registration - Not a field, custom entities - A work in progress!
  34. 34. MODULES COMPARED 34
  35. 35. REGISTRATION 35 - Does it need to be in Drupal? Eventbrite, etc - Simple use cases: Webform - Complex use cases: Recurring Events - Consider Bookable Calendar - Even more robust - BEE - Bookable Entities Everywhere - RNG - Events and Registration - BAT - Booking and Availability Management Tools
  36. 36. ADDRESSING THE PROBLEMS 36 SPEED Timestamps for better performance FORMAT Intelligent formatting of output, translatable EDITOR UX JS-rich interface provides app-like functionality SITE BUILDERS Recurring dates Interactive calendars Timezones
  37. 37. BADCamp 2020 Coming up next Friday 10 am ● Best practices for building multilingual sites in Drupal 8 with Mohit Aghera ● Classic Website Blunders with Stephen Pashby ● Facets in Drupal 8: supercharged filtering of listings with Nick Dickinson-Wilde ● New CSS Tech: Tell Your Designers! with Mike Herchel
  38. 38. 38 COMMENTS QQUESTIONS
  39. 39. 39 THANKS!

×