mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
⚡ format dates in fixtures
This commit is contained in:
parent
3cac2ac979
commit
2440c739e2
3
.env
3
.env
@ -25,5 +25,6 @@ APP_SECRET=597b0529ac702d27dcb9089f7e69c362
|
||||
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
|
||||
# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11"
|
||||
# IMPORTANT: You MUST also configure your db driver and server_version in config/packages/doctrine.yaml
|
||||
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
|
||||
DATABASE_URL=mysql://root:plopplop01@127.0.0.1:3306/tykayn
|
||||
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
@ -175,11 +175,11 @@ class AppPollFixtures extends Fixture {
|
||||
$poll = new Poll();
|
||||
$choice = new Choice();
|
||||
$firstDate = new DateTime();
|
||||
$choice->setName( $firstDate );
|
||||
$choice->setName( $firstDate->format( 'Y-m-d H:i:s' ) );
|
||||
$choice2 = new Choice();
|
||||
$choice3 = new Choice();
|
||||
$choice2->setName( $poll->addDaysToDate( $firstDate, 1 ) );
|
||||
$choice3->setName( $poll->addDaysToDate( $firstDate, 2 ) );
|
||||
$choice2->setName( $poll->addDaysToDate( $firstDate, 1 )->format( 'Y-m-d H:i:s' ) );
|
||||
$choice3->setName( $poll->addDaysToDate( $firstDate, 2 )->format( 'Y-m-d H:i:s' ) );
|
||||
|
||||
$poll->setTitle( "c'est pour aujourdhui ou pour demain" )
|
||||
->setDescription( 'Vous avez le choix dans la date' )
|
||||
|
Loading…
Reference in New Issue
Block a user