{"id":2648,"date":"2014-01-14T15:42:25","date_gmt":"2014-01-14T20:42:25","guid":{"rendered":"http:\/\/blogs.terrorware.com\/geoff\/?p=2648"},"modified":"2014-01-14T15:42:25","modified_gmt":"2014-01-14T20:42:25","slug":"custom-formatting-of-date-and-time-for-events-in-in-squarespace-blocks","status":"publish","type":"post","link":"http:\/\/blogs.terrorware.com\/geoff\/2014\/01\/14\/custom-formatting-of-date-and-time-for-events-in-in-squarespace-blocks\/","title":{"rendered":"Custom formatting of date and time for events in in Squarespace blocks"},"content":{"rendered":"<p>I&#8217;ve recently done a little bit of front-end development work on a Squarespace website.\u00a0 This is my first experience with the platform, and it&#8217;s been generally positive.\u00a0 It starts out with a sane content model and makes all the content available as JSON.<\/p>\n<p>The system provides a number of predefined blocks that let you expose content from\u00a0 collections on other pages in the site.\u00a0 Unfortunately, as of January 2014, you can&#8217;t customize the markup of items in a block.<\/p>\n<p>This was a problem for us because the default summary block for event content only showed the event date and we wanted to also show the start time.\u00a0 Luckily, the JSON feed of the events collection provided timestamps for the start and end date\/time.<\/p>\n<p>I wrote <a href=\"http:\/\/github.com\/ghing\/sqs-event-list\">Squarespace Event List<\/a>, a YUI3 plugin that fetches the event collection JSON with AJAX and overwrites a block&#8217;s content with a custom-formatted event list.\u00a0 <a href=\"https:\/\/github.com\/ghing\/sqs-event-list\">You can find the JavaScript and some brief documentation on GitHub<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve recently done a little bit of front-end development work on a Squarespace website.\u00a0 This is my first experience with the platform, and it&#8217;s been generally positive.\u00a0 It starts out with a sane content model and makes all the content available as JSON. The system provides a number of predefined blocks that let you expose&hellip; <a class=\"more-link\" href=\"http:\/\/blogs.terrorware.com\/geoff\/2014\/01\/14\/custom-formatting-of-date-and-time-for-events-in-in-squarespace-blocks\/\">Continue reading <span class=\"screen-reader-text\">Custom formatting of date and time for events in in Squarespace blocks<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21250],"tags":[21253,844,20509,474,21251,21252],"class_list":["post-2648","post","type-post","status-publish","format-standard","hentry","category-work-2","tag-date","tag-event","tag-javascript","tag-plugin","tag-squarespace","tag-yui3","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4wnIz-GI","_links":{"self":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts\/2648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/comments?post=2648"}],"version-history":[{"count":2,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts\/2648\/revisions"}],"predecessor-version":[{"id":2650,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts\/2648\/revisions\/2650"}],"wp:attachment":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/media?parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/categories?post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/tags?post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}