1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

migration from framadate 1 choice name using separator for timeSlices in name

This commit is contained in:
Tykayn 2021-05-18 23:42:10 +02:00 committed by tykayn
parent afef8edd0b
commit 5716642c09

View File

@ -97,10 +97,10 @@ class MigrationController extends EmailsController {
$moments = explode( ',', $d->moments );
foreach ( $moments as $moment ) {
$newChoice = new Choice();
$dateOfDay = date_create( strtotime( $d->title ) );
$newChoice
->setPoll( $poll )
->setDateTime( date_create( strtotime( $d->title ) ) )
->setName( $moment );
->setName( $dateOfDay->format('y-m-d'). ' >>> ' . $moment );
$pollChoicesOrderedBySlug[ $pollSlug ][] = $newChoice;
$poll->addChoice( $newChoice );