{"id":1018034,"date":"2015-10-26T11:08:27","date_gmt":"2015-10-26T18:08:27","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/"},"modified":"2015-10-26T14:30:52","modified_gmt":"2015-10-26T21:30:52","slug":"event-shows-with-wrong-date-yesterday","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/","title":{"rendered":"Event icon shows wrong date (yesterday)"},"content":{"rendered":"<p>Hey there,<\/p>\n<p>I had the problem that the calendar icon in the list view of a todays event was showing yesterdays day and date (e.g. Sunday 25. instead of Monday 26.).<\/p>\n<p>I had to remove a line in the widgets.php of the events-calendar-pro extension and modify the date.php of the the-events-calendar extension to get it working correctly:<\/p>\n<p>date.php:<\/p>\n<pre><code>\t\/**\n\t * Returns formatted date for the official end of the day according to the Multi-day cutoff time option\n\t *\n\t * @category Events\n\t * @param string $date   The date to find the end of the day, defaults to today\n\t * @param string $format Allows date and time formating using standard php syntax (http:\/\/php.net\/manual\/en\/function.date.php)\n\t *\n\t * @return string\n\t *\/\n\tfunction tribe_event_end_of_day( $date = null, $format = &#039;Y-m-d H:i:s&#039; ) {\n\t\t$multiday_cutoff = explode( &#039;:&#039;, tribe_get_option( &#039;multiDayCutoff&#039;, &#039;00:00&#039; ) );\n\t\t$hours_to_add    = $multiday_cutoff[0];\n\t\t$minutes_to_add  = $multiday_cutoff[1];\n\n\t\tif ( is_null( $date ) || empty( $date ) ) {\n\t\t\treturn apply_filters( &#039;tribe_event_end_of_day&#039;, date( $format, strtotime( &#039;tomorrow  +&#039; . $hours_to_add . &#039; hours &#039; . $minutes_to_add . &#039; minutes&#039; ) - 1 ) );\n\t\t} else {\n\t\t\tif ($format == &#039;U&#039;) {\n\t\t\t\treturn apply_filters( &#039;tribe_event_end_of_day&#039;, date( $format, strtotime( date( &#039;Y-m-d&#039;, $date) . &#039; +1 day &#039; . $hours_to_add . &#039; hours &#039; . $minutes_to_add . &#039; minutes&#039; ) - 1));\n\t\t\t} else {\n\t\t\t\treturn apply_filters( &#039;tribe_event_end_of_day&#039;, date( $format, strtotime( date( &#039;Y-m-d&#039;, strtotime( $date ) ) . &#039; +1 day &#039; . $hours_to_add . &#039; hours &#039; . $minutes_to_add . &#039; minutes&#039; ) - 1));\n\t\t\t}\n\t\t}\n\t}<\/code><\/pre>\n<p>widget.php<\/p>\n<pre><code>\/**\n * Returns the event date, or today&#039;s date if the event has started and is not over yet.\n *\n * @return int\n **\/\nfunction tribe_events_get_widget_event_post_date() {\n\tglobal $post, $wp_query;\n\n\t$startDate = strtotime( $post-&gt;EventStartDate );\n\t$endDate   = strtotime( $post-&gt;EventEndDate );\n\n\t$is_multiday = tribe_event_is_multiday( $post-&gt;ID );\n\t$is_all_day = tribe_event_is_all_day( $post-&gt;ID );\n\n\t$today     = current_time( &#039;timestamp&#039; );\n\t$yesterday = $today - DAY_IN_SECONDS;\n\n\t\/\/ Gets Yesterday cutoff to check which date we pick\n\t$yesterday_end = ( (int) tribe_event_end_of_day( $yesterday, &#039;U&#039; ) ) + 1;\n\n\t\/\/ Check if the yesterday cutoff will get the start date of the event\n\tif ( $yesterday_end &gt;= $startDate &amp;&amp; ! $is_multiday &amp;&amp; ! $is_all_day ) {\n\t\t$postDate = $yesterday;\n\t\/\/ If the event starts way in the past or ends way in the future, let&#039;s show today&#039;s date\n\t} elseif ( $today &gt; $startDate &amp;&amp; $today &lt; $endDate ) {\n\t\t$postDate = $today;\n\t} else {\n\t\t$postDate = $startDate;\n\t}\n\n\t\/* If the user clicked in a particular day, let&#039;s show that day as the event date, even if the event spans a few days *\/\n\tif ( defined( &#039;DOING_AJAX&#039; ) &amp;&amp; DOING_AJAX &amp;&amp; isset( $_POST[&#039;action&#039;] ) &amp;&amp; $_POST[&#039;action&#039;] == &#039;tribe-mini-cal-day&#039; ) {\n\t\t$postDate = strtotime( $_POST[&#039;eventDate&#039;] );\n\t}\n\n\treturn apply_filters( &#039;tribe_events_get_widget_event_post_date&#039;, $postDate );\n}<\/code><\/pre>\n<p>Maybe you can fix that in a future version?<\/p>\n","protected":false},"template":"","class_list":["post-1018034","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>Event icon shows wrong date (yesterday) -<\/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\/event-shows-with-wrong-date-yesterday\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event icon shows wrong date (yesterday) -\" \/>\n<meta property=\"og:description\" content=\"Hey there, I had the problem that the calendar icon in the list view of a todays event was showing yesterdays day and date (e.g. Sunday 25. instead of Monday 26.). I had to remove a line in the widgets.php of the events-calendar-pro extension and modify the date.php of the the-events-calendar extension to get it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-10-26T21:30:52+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\/event-shows-with-wrong-date-yesterday\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/\",\"name\":\"Event icon shows wrong date (yesterday) -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-10-26T18:08:27+00:00\",\"dateModified\":\"2015-10-26T21:30:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/#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\":\"Event icon shows wrong date (yesterday)\"}]},{\"@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":"Event icon shows wrong date (yesterday) -","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\/event-shows-with-wrong-date-yesterday\/","og_locale":"en_US","og_type":"article","og_title":"Event icon shows wrong date (yesterday) -","og_description":"Hey there, I had the problem that the calendar icon in the list view of a todays event was showing yesterdays day and date (e.g. Sunday 25. instead of Monday 26.). I had to remove a line in the widgets.php of the events-calendar-pro extension and modify the date.php of the the-events-calendar extension to get it [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/","article_modified_time":"2015-10-26T21:30:52+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\/event-shows-with-wrong-date-yesterday\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/","name":"Event icon shows wrong date (yesterday) -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-10-26T18:08:27+00:00","dateModified":"2015-10-26T21:30:52+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-shows-with-wrong-date-yesterday\/#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":"Event icon shows wrong date (yesterday)"}]},{"@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\/1018034","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1018034\/revisions"}],"predecessor-version":[{"id":1018073,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1018034\/revisions\/1018073"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1018034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}