init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?php
namespace Laraspace\Space;
use Carbon\Carbon;
class DateFormatter
{
protected static $formats = [
[
"carbon_format" => "Y M d",
"moment_format" => "YYYY MMM DD"
],
[
"carbon_format" => "d M Y",
"moment_format" => "DD MMM YYYY"
],
[
"carbon_format" => "d/m/Y",
"moment_format" => "DD/MM/YYYY"
],
[
"carbon_format" => "d.m.Y",
"moment_format" => "DD.MM.YYYY"
],
[
"carbon_format" => "d-m-Y",
"moment_format" => "DD-MM-YYYY"
],
[
"carbon_format" => "m/d/Y",
"moment_format" => "MM/DD/YYYY"
],
[
"carbon_format" => "Y/m/d",
"moment_format" => " YYYY/MM/DD"
],
[
"carbon_format" => "Y-m-d",
"moment_format" => "YYYY-MM-DD"
],
];
public static function get_list()
{
$new = [];
foreach (static::$formats as $format) {
$new[] = array(
"display_date" => Carbon::now()->format($format['carbon_format']) ,
"carbon_format_value" => $format['carbon_format'],
"moment_format_value" => $format['moment_format']
);
}
return $new;
}
}