Answers.Body: <p>Try: Administer &gt; Localisation &gt; Date Formats</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-17T20:15:26.500Z
Answers.Text: The definition of **"What I have"** is exactly that. It is already set correctly, but you can see that the CiviEvent widget disregards this and just does its own thing.
Answers.UserDisplayName: Torben Gundtofte-Bruun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-17T20:24:01.377Z
Answers.Text: I see that the plugin was [last updated 5 years ago](https://wordpress.org/plugins/civievent-widget) and [this bug has already been reported 4½ years ago](https://wordpress.org/support/topic/custom-date-time-format/), so I guess the code is abandoned. Dang!
Answers.UserDisplayName: Torben Gundtofte-Bruun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-18T19:05:12.040Z
Answers.Text: Right. My bad, i didn't read the question well enough before I answered, and therefore i didn't realise this involved a 3rd party extension.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-18T20:39:54.447Z
Answers.Text: I would be grateful if you could suggest alternative solutions! (see also [this related question](https://civicrm.stackexchange.com/questions/45695/how-to-show-courses-events-as-a-table-listing-in-wordpress))
Answers.UserDisplayName: Torben Gundtofte-Bruun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-19T18:39:38.060Z
Answers.Text: Have you read up about SearchKit? We don't do a lot of WP work. You may want to ask at https://chat.civicrm.org/civicrm/channels/search-improvements
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-19T18:40:29.697Z
Answers.Text: Oh i see that is the answer in that 'related question'
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-15T20:36:10.657Z
Answers.LastActivityDate: 2023-10-15T20:36:10.657Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>At lines 188-200 in civievent-widget.php</p>
  <p>You can change the original parameters to  %d.%B.%Y and %H:%M</p>
  <pre><code>// Get date and time formats.
      $params = array( 'name' =&gt; 'date_format' );
      $values = array();
      CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
      $this-&gt;_dateFormat = CRM_Utils_Array::value( 'date_format', $values, '%A %d %B %Y' );
      $params = array( 'name' =&gt; 'time_format' );
      $values = array();
      CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
      $this-&gt;_timeFormat = CRM_Utils_Array::value( 'time_format', $values, '%H:%M' );
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-08T16:31:46.457Z
Answers.LastActivityDate: 2024-03-08T16:31:46.457Z
Answers.UserDisplayName: Fredatipik
Body: <p>I am trying to work with the <a href="https://wordpress.org/plugins/civievent-widget" rel="nofollow noreferrer">CiviEvent widget</a> but several things baffle me. First, the date format is all wrong and I don't see a way to change that? The date is correct on the event page, but not in CiviEvent.</p>
  <p><strong>What I have:</strong> Date format is set to <code>%E.%b%Y %H:%M</code><br />
  <strong>What I get:</strong> <code>Okt. 22, 2023 5:15 pm</code><br />
  <strong>What I expect:</strong> <code>22.Okt.2023 17:15</code></p>
  <p>How can I get the widget to output the correct date format?</p>
  <p><strong>Edit:</strong> I see that the plugin was <a href="https://wordpress.org/plugins/civievent-widget" rel="nofollow noreferrer">last updated 5 years ago</a> and <a href="https://wordpress.org/support/topic/custom-date-time-format/" rel="nofollow noreferrer">this bug has already been reported 4½ years ago</a>, so I guess the code is abandoned and there will be no solution to this problem until someone publishes a fork that fixes this. Dang!</p>
  <p><strong>Edit 2:</strong> I contacted the devs and they responded that &quot;It's definitely patch-welcome, so not strictly abandoned, but we aren't proactively doing work on it.&quot; I am not a sufficiently skilled developer to fix this, so it will have to be that way.</p>
  
Tags: <civievent>
Title: CiviEvent widget: change date format?
ThreadText: # CiviEvent widget: change date format?
  
  (Asked by: username_0 on 2023-10-15)
  
  I am trying to work with the [CiviEvent widget](https://wordpress.org/plugins/civievent-widget) but several things baffle me. First, the date format is all wrong and I don't see a way to change that? The date is correct on the event page, but not in CiviEvent.
  
  **What I have:** Date format is set to `%E.%b%Y %H:%M`  
  **What I get:** `Okt. 22, 2023 5:15 pm`  
  **What I expect:** `22.Okt.2023 17:15`
  
  How can I get the widget to output the correct date format?
  
  **Edit:** I see that the plugin was [last updated 5 years ago](https://wordpress.org/plugins/civievent-widget) and [this bug has already been reported 4½ years ago](https://wordpress.org/support/topic/custom-date-time-format/), so I guess the code is abandoned and there will be no solution to this problem until someone publishes a fork that fixes this. Dang!
  
  **Edit 2:** I contacted the devs and they responded that "It's definitely patch-welcome, so not strictly abandoned, but we aren't proactively doing work on it." I am not a sufficiently skilled developer to fix this, so it will have to be that way.
  
  **Tags:** civievent
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-10-15. Score: 0
  
  Try: Administer > Localisation > Date Formats
  
  > **Comments:**
  > **username_0**: The definition of **"What I have"** is exactly that. It is already set correctly, but you can see that the CiviEvent widget disregards this and just does its own thing.  
  > **username_0**: I see that the plugin was [last updated 5 years ago](https://wordpress.org/plugins/civievent-widget) and [this bug has already been reported 4½ years ago](https://wordpress.org/support/topic/custom-date-time-format/), so I guess the code is abandoned. Dang!  
  > **username_1**: Right. My bad, i didn't read the question well enough before I answered, and therefore i didn't realise this involved a 3rd party extension.  
  > **username_0**: I would be grateful if you could suggest alternative solutions! (see also [this related question](https://civicrm.stackexchange.com/questions/45695/how-to-show-courses-events-as-a-table-listing-in-wordpress))  
  > **username_1**: Have you read up about SearchKit? We don't do a lot of WP work. You may want to ask at https://chat.civicrm.org/civicrm/channels/search-improvements  
  > **username_1**: Oh i see that is the answer in that 'related question'  
  
  ---
  
  ### Answer by username_2 on 2024-03-08. Score: 0
  
  At lines 188-200 in civievent-widget.php
  
  You can change the original parameters to %d.%B.%Y and %H:%M
  
  ```
  // Get date and time formats.
      $params = array( 'name' => 'date_format' );
      $values = array();
      CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
      $this->_dateFormat = CRM_Utils_Array::value( 'date_format', $values, '%A %d %B %Y' );
      $params = array( 'name' => 'time_format' );
      $values = array();
      CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
      $this->_timeFormat = CRM_Utils_Array::value( 'time_format', $values, '%H:%M' );
  }
  
  ```
  
  
  ---
  
  