{"id":1365071,"date":"2017-10-17T19:12:21","date_gmt":"2017-10-18T02:12:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/"},"modified":"2017-10-17T19:12:21","modified_gmt":"2017-10-18T02:12:21","slug":"change-beginning-start-date-week-widget","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/","title":{"rendered":"Change Beginning Start Date &#8211; Week Widget"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Here was my previous Post:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"BOqO9kti2E\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-week-widget-start-date-title\/\">Change Week Widget Start Date &amp; Title<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Change Week Widget Start Date &amp; Title&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-week-widget-start-date-title\/embed\/#?secret=uqBaESm1Fy#?secret=BOqO9kti2E\" data-secret=\"BOqO9kti2E\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>I managed to overwrite the template to make the necessary adjustments for almost all items. The issue I am having is that the First date of the Calendar is not Today.<\/p>\n<p>Website: www.BocaCal.com (See Sidebar)<\/p>\n<p>In the previous thread I was provided the file to view and I narrowed down the area of the PHP file to adjust. The problem I am having is I cannot figure it out from here.<\/p>\n<pre><code>\/**\n * This Week Widget - Get the first day of current week with provided date or current week\n *\n * @param null|mixed $date  given date or week # (week # assumes current year)\n * @param null $week_offset # offset from current week the start date for this widget\n *\n * @return DateTime\n *\/\nfunction tribe_get_this_week_first_week_day( $date = null, $week_offset = null ) {\n\n\t\/\/Start of Week in WordPress Settings - Zero = Sunday, 1 = Monday, etc\n\t$offset = 0 - get_option( &#039;start_of_week&#039;, 0 );\n\n\t\/\/Check for Valid Date\n\ttry {\n\t\t$date = new DateTime( $date );\n\t} catch ( exception $e ) {\n\t\t$date = new DateTime();\n\t}\n\n\t\/\/ Clone to avoid altering the original date\n\t$r = clone $date;\n\t\/\/Use Offset to get Start of Week for Widget\n\t$r-&gt;modify( - ( ( $date-&gt;format( &#039;w&#039; ) + $offset ) % 7 ) . &#039;days&#039; );\n\n\t\/\/Add Week Offset if there\n\tempty( $week_offset ) ? null : $r-&gt;modify( &#039;+&#039; . absint( $week_offset ) . &#039; weeks&#039; );\n\n\treturn $r-&gt;format( Tribe__Date_Utils::DBDATEFORMAT );\n}<\/code><\/pre>\n<p>Any help would be greatly appreciated &#8211; Thanks!<\/p>\n<p>Regards,<br \/>\nJeff<\/p>\n","protected":false},"template":"","class_list":["post-1365071","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>Change Beginning Start Date - Week Widget -<\/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\/change-beginning-start-date-week-widget\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Beginning Start Date - Week Widget -\" \/>\n<meta property=\"og:description\" content=\"Hi, Here was my previous Post: Change Week Widget Start Date &amp; Title I managed to overwrite the template to make the necessary adjustments for almost all items. The issue I am having is that the First date of the Calendar is not Today. Website: www.BocaCal.com (See Sidebar) In the previous thread I was provided [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/\",\"name\":\"Change Beginning Start Date - Week Widget -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-10-18T02:12:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/#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\":\"Change Beginning Start Date &#8211; Week Widget\"}]},{\"@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":"Change Beginning Start Date - Week Widget -","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\/change-beginning-start-date-week-widget\/","og_locale":"en_US","og_type":"article","og_title":"Change Beginning Start Date - Week Widget -","og_description":"Hi, Here was my previous Post: Change Week Widget Start Date &amp; Title I managed to overwrite the template to make the necessary adjustments for almost all items. The issue I am having is that the First date of the Calendar is not Today. Website: www.BocaCal.com (See Sidebar) In the previous thread I was provided [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/","name":"Change Beginning Start Date - Week Widget -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-10-18T02:12:21+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-beginning-start-date-week-widget\/#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":"Change Beginning Start Date &#8211; Week Widget"}]},{"@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\/1365071","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\/1365071\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1365071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}