我正在使用wordpress的日历,因此遇到以下问题:我从查询中获取的数据与日期选择器格式不匹配
要获取数组的零件如下
<?php
$my_array = array();
// the query
$args=array(
'post_type' => 'eventos',
'order'=>'ASC');
$posts = get_posts( $args );
if ( $posts ) {
foreach ( $posts as $post ) {
$my_array[] = array(
'Title' => $post->post_title,
'Date' => date_format(date_create('@'. strtotime(get_field('data-event'))), 'r') . "\n"
,
);
}
}
print_r($my_array);
?>
var events = [
{ Title: "Evento 1", Date: new Date("05/20/2020")},
{ Title: "Evento 2", Date: new Date("05/20/2020")},
{ Title: "Evento 3", Date: new Date("05/21/2020")},];
有什么想法可以使它们平等吗?