Skip to content

Commit

Permalink
Fixed issue : Unable to use month in date
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Mar 27, 2017
1 parent 6312d81 commit 8b5d809
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions application/helpers/surveytranslator_helper.php
Expand Up @@ -801,30 +801,15 @@ function getPHPDateFromDateFormat($sDateformat)
/**
* Convert a 'dateformat' format string to a 'jsdate' format.
* For Bootstrap, that means using capital letters, e.g.
* MM/DD/YYYY instead of mm/dd/yyyy.
* MM/DD/YYYY instead of mm/dd/yyyy and mm instead of MM for minutes.
*
* @param $sDateformat string
* @returns string
*
*/
function getJSDateFromDateFormat($sDateformat)
{
$newDateFormat = str_replace(
array(
"d", // day
"m", // month
"y", // year
"M", // minutes
),
array(
"D", // day
"M", // month
"Y", // year
"m", // minutes
),
$sDateformat
);
return $newDateFormat;
return strtr($sDateformat,"dmyM","DMYm");
}


Expand Down

0 comments on commit 8b5d809

Please sign in to comment.