Skip to content

Commit

Permalink
Fixes for date formats using React
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Jul 18, 2022
1 parent feb4bb6 commit dda60fb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$df = App\Models\DateFormat::find(7);
$df->format_moment = 'ddd MMM D, YYYY';
$df->save();

$df = App\Models\DateFormat::find(14);
$df->format_moment = 'DD/MM/YYYY';
$df->save();

}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};
4 changes: 2 additions & 2 deletions database/seeders/DateFormatsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function run()
['id' => 4, 'format' => 'd-F-Y', 'format_moment' => 'DD-MMMM-YYYY', 'format_dart' => 'dd-MMMM-yyyy'],
['id' => 5, 'format' => 'M j, Y', 'format_moment' => 'MMM D, YYYY', 'format_dart' => 'MMM d, yyyy'],
['id' => 6, 'format' => 'F j, Y', 'format_moment' => 'MMMM D, YYYY', 'format_dart' => 'MMMM d, yyyy'],
['id' => 7, 'format' => 'D M j, Y', 'format_moment' => 'ddd MMM Do, YYYY', 'format_dart' => 'EEE MMM d, yyyy'],
['id' => 7, 'format' => 'D M j, Y', 'format_moment' => 'ddd MMM D, YYYY', 'format_dart' => 'EEE MMM d, yyyy'],
['id' => 8, 'format' => 'Y-m-d', 'format_moment' => 'YYYY-MM-DD', 'format_dart' => 'yyyy-MM-dd'],
['id' => 9, 'format' => 'd-m-Y', 'format_moment' => 'DD-MM-YYYY', 'format_dart' => 'dd-MM-yyyy'],
['id' => 10, 'format' => 'm/d/Y', 'format_moment' => 'MM/DD/YYYY', 'format_dart' => 'MM/dd/yyyy'],
['id' => 11, 'format' => 'd.m.Y', 'format_moment' => 'D.MM.YYYY', 'format_dart' => 'dd.MM.yyyy'],
['id' => 12, 'format' => 'j. M. Y', 'format_moment' => 'DD. MMM. YYYY', 'format_dart' => 'd. MMM. yyyy'],
['id' => 13, 'format' => 'j. F Y', 'format_moment' => 'DD. MMMM YYYY', 'format_dart' => 'd. MMMM yyyy'],
['id' => 14, 'format' => 'd/m/Y', 'format_moment' => 'DD/MM/YYY', 'format_dart' => 'dd/MM/yyyy'],
['id' => 14, 'format' => 'd/m/Y', 'format_moment' => 'DD/MM/YYYY', 'format_dart' => 'dd/MM/yyyy'],
];

foreach ($formats as $format) {
Expand Down

0 comments on commit dda60fb

Please sign in to comment.