{"id":153103,"date":"2014-05-07T13:31:34","date_gmt":"2014-05-07T20:31:34","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/removing-end-date-and-time\/"},"modified":"2014-05-08T08:47:44","modified_gmt":"2014-05-08T15:47:44","slug":"removing-end-date-and-time","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/","title":{"rendered":"Removing end date and time"},"content":{"rendered":"<p>I&#8217;m posting this not so much for support as really just to share something with others and possibly get feedback on my method.<\/p>\n<p>I got a request from a client I&#8217;m building a site for that at first really challenged me for a few minutes. The request was to remove the end date and time from all events. My client had no use for this feature and didn&#8217;t ever want this information to display. I wasn&#8217;t aware of any simple way to accomplish this so I eventually had to devise a hack of sorts to make it happen. Then I thought to myself &#8220;I should share this over on the tri.be forum&#8221; so here I am.<\/p>\n<p>Basically here&#8217;s what I did:<\/p>\n<p>First off, I recognized that if the start date and time were the same as the end date and time, only the start info would display. So I ended up creating this little function which I threw in my functions.php file and seems to do the trick:<\/p>\n<p>function rbm_remove_event_date($post_id) {<br \/>\n\t$post_type = get_post_type( $post_id );<br \/>\n\tif ($post_type != &#8216;tribe_events&#8217;) {<br \/>\n\t\treturn;<br \/>\n\t} else {<br \/>\n\t$start_date = get_post_meta($post_id, &#8216;_EventStartDate&#8217;, true);<br \/>\n\tupdate_post_meta($post_id, &#8216;_EventEndDate&#8217;, $start_date);<br \/>\n\t}<br \/>\n}<br \/>\nadd_action(&#8216;save_post&#8217;, &#8216;rbm_remove_event_date&#8217;, 99);<\/p>\n<p>What this does is just sets the end event date and time to be the same as the start date and time when the post is saved.<\/p>\n<p>Next I went along and hid the fields on the edit posts screen with some CSS:<\/p>\n<p>#EventInfo .eventtable tbody tr:nth-of-type(4) {<br \/>\ndisplay: none;<br \/>\n}<\/p>\n<p>There it is. I just wanted to share this. I guess if someone has feedback on maybe a better way I&#8217;d be curious to see it. Or if someone spots flaws in this approach.<\/p>\n<p>Anyway, thanks for developing this great plugin.<\/p>\n","protected":false},"template":"","class_list":["post-153103","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Removing end date and time -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Removing end date and time -\" \/>\n<meta property=\"og:description\" content=\"I&#8217;m posting this not so much for support as really just to share something with others and possibly get feedback on my method. I got a request from a client I&#8217;m building a site for that at first really challenged me for a few minutes. The request was to remove the end date and time [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-05-08T15:47:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/\",\"name\":\"Removing end date and time -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-05-07T20:31:34+00:00\",\"dateModified\":\"2014-05-08T15:47:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Removing end date and time\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Removing end date and time -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/","og_locale":"en_US","og_type":"article","og_title":"Removing end date and time -","og_description":"I&#8217;m posting this not so much for support as really just to share something with others and possibly get feedback on my method. I got a request from a client I&#8217;m building a site for that at first really challenged me for a few minutes. The request was to remove the end date and time [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/","article_modified_time":"2014-05-08T15:47:44+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/","name":"Removing end date and time -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-05-07T20:31:34+00:00","dateModified":"2014-05-08T15:47:44+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-end-date-and-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Removing end date and time"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/153103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/153103\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=153103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}