ninja_forms_date_to_datepicker

The Ninja Forms ninja forms date to datepicker function.

Description

ninja_forms_date_to_datepicker( $date ); 

Parameters (1)

0. $date
The date.

Usage

  1. if ( !function_exists( 'ninja_forms_date_to_datepicker' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/admin.php'; 
  3.  
  4. // The date. 
  5. $date = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ninja_forms_date_to_datepicker($date); 
  9.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/admin/admin.php  
  1. function ninja_forms_date_to_datepicker($date) { 
  2. $pattern = array( 
  3.  
  4. //day 
  5. 'd', //day of the month 
  6. 'j', //3 letter name of the day 
  7. 'l', //full name of the day 
  8. 'z', //day of the year 
  9.  
  10. //month 
  11. 'F', //Month name full 
  12. 'M', //Month name short 
  13. 'n', //numeric month no leading zeros 
  14. 'm', //numeric month leading zeros 
  15.  
  16. //year 
  17. 'Y', //full numeric year 
  18. 'y' //numeric year: 2 digit 
  19. ); 
  20. $replace = array( 
  21. 'dd', 'd', 'DD', 'o',  
  22. 'MM', 'M', 'm', 'mm',  
  23. 'yy', 'y' 
  24. ); 
  25. foreach($pattern as &$p) { 
  26. $p = '/'.$p.'/'; 
  27. return preg_replace($pattern, $replace, $date);