Merge pull request #19017 from eileenmcnaughton/remove_recur
[civicrm-core.git] / CRM / Utils / Date.php
index 831fca5bc8f5cd6397527e191616b7187a04ac39..af0fd42584f995dae429f69b398f3e2afff2d3f9 100644 (file)
@@ -26,7 +26,7 @@ class CRM_Utils_Date {
    * @param array $date
    *   ('Y', 'M', 'd').
    * @param string $separator
-   *   The seperator to use when formatting the date.
+   *   The separator to use when formatting the date.
    * @param int|string $invalidDate what to return if the date is invalid
    *
    * @return string
@@ -422,6 +422,19 @@ class CRM_Utils_Date {
     }
   }
 
+  /**
+   * Format the field according to the site's preferred date format.
+   *
+   * This is likely to look something like December 31st, 2020.
+   *
+   * @param string $date
+   *
+   * @return string
+   */
+  public static function formatDateOnlyLong(string $date):string {
+    return CRM_Utils_Date::customFormat($date, Civi::settings()->get('dateformatFull'));
+  }
+
   /**
    * Wrapper for customFormat that takes a timestamp
    *