Project

General

Profile

« Previous | Next » 

Revision 0a288588

Added by Andreas Kohlbecker about 7 years ago

#5723 fixing several problems with the reference page

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
765 765
 */
766 766
function timePeriodToString($period, $stripZeros = TRUE, $format = "YYYY-MM-DD") {
767 767
  $dateString = '';
768
  if ($period->start) {
769
    $dateString = partialToDate($period->start, $stripZeros, $format);
770
  }
771
  if ($period->end) {
772
    $dateString .= (strlen($dateString) > 0 ? ' ' . t('to') . ' ' : '') . partialToDate($period->end, $stripZeros, $format);
768
  if($period->freeText){
769
    $dateString = $period->freeText;
770
  } else {
771
    if ($period->start) {
772
      $dateString = partialToDate($period->start, $stripZeros, $format);
773
    }
774
    if ($period->end) {
775
      $dateString .= (strlen($dateString) > 0 ? ' ' . t('to') . ' ' : '') . partialToDate($period->end, $stripZeros, $format);
776
    }
773 777
  }
774 778
  return $dateString;
775 779
}

Also available in: Unified diff