/**
 * Get the date format details for a specific question.
 *
 * @param $aQidAttributes array Question attributes
 * @param $mThisSurvey mixed Array of Survey attributes or surveyid
 * @returns array
 *
 */
function getDateFormatDataForQID($aQidAttributes, $mThisSurvey)
{
    if (isset($aQidAttributes['date_format']) && trim($aQidAttributes['date_format']) != '') {
        $aDateFormatDetails = array();
        $aDateFormatDetails['dateformat'] = trim($aQidAttributes['date_format']);
        $aDateFormatDetails['phpdate'] = getPHPDateFromDateFormat($aDateFormatDetails['dateformat']);
        $aDateFormatDetails['jsdate'] = getJSDateFromDateFormat($aDateFormatDetails['dateformat']);
    } else {
        if (!is_array($mThisSurvey)) {
            $mThisSurvey = array('surveyls_dateformat' => getDateFormatForSID($mThisSurvey));
        }
        $aDateFormatDetails = getDateFormatData($mThisSurvey['surveyls_dateformat']);
    }
    return $aDateFormatDetails;
}
/**
 * Get the date format details for a specific question.
 *
 * @param $aQidAttributes array Question attributes
 * @param $mThisSurvey mixed Array of Survey attributes or surveyid
 * @returns array
 *
 */
function getDateFormatDataForQID($aQidAttributes, $mThisSurvey)
{
    if (isset($aQidAttributes['date_format']) && trim($aQidAttributes['date_format']) != '') {
        $aDateFormatDetails = array();
        $aDateFormatDetails['dateformat'] = trim($aQidAttributes['date_format']);
        $aDateFormatDetails['phpdate'] = getPHPDateFromDateFormat($aDateFormatDetails['dateformat']);
        $aDateFormatDetails['jsdate'] = getJSDateFromDateFormat($aDateFormatDetails['dateformat']);
        $aDateFormatDetails['jsdate_original'] = $aDateFormatDetails['dateformat'];
        // In dropdown, this is fed to Date in Javascript, not Bootstrap
    } else {
        if (!is_array($mThisSurvey)) {
            $mThisSurvey = array('surveyls_dateformat' => getDateFormatForSID($mThisSurvey));
        }
        $aDateFormatDetails = getDateFormatData($mThisSurvey['surveyls_dateformat']);
    }
    return $aDateFormatDetails;
}