Skip to content

Instantly share code, notes, and snippets.

@taciara
Created February 25, 2019 19:45
Show Gist options
  • Save taciara/ec930916b0abbef17539e615816ed310 to your computer and use it in GitHub Desktop.
Save taciara/ec930916b0abbef17539e615816ed310 to your computer and use it in GitHub Desktop.
Uma extensão do ACF para selecionar multiplas datas
<?php //Utilizando ACF Multi Dates Field - Uma extensão do ACF para selecionar multiplas datas ?>
<?php
setlocale (LC_ALL, 'pt_BR');
$dataArray = get_field('data_curso');
$data = end($dataArray);
$periodoCurso = array_map(function($value) use($data){
if($data == $value)
return strftime('%d de %B de %Y',strtotime($value));
return strftime('%d',strtotime($value));
}, $dataArray);
$periodoCurso = implode(', ', $periodoCurso);
?>
<span class="txt"><?php echo $periodoCurso; ?></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment