Skip to content

Commit

Permalink
Improve datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
kekefreedog committed May 10, 2024
1 parent 3d387d7 commit 1497d8f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
42 changes: 42 additions & 0 deletions resources/Extensions/CrazyAuth/Scripts/Database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php declare(strict_types=1);
/**
* Crazy Auth Interface
*
* PHP version 8.1.2
*
* @package kzarshenas/crazyphp
* @author kekefreedog <kevin.zarshenas@gmail.com>
* @copyright 2022-2024 Kévin Zarshenas
*/
namespace CrazyAuth;

/**
* Dependances
*/

use CrazyPHP\Library\Exception\ExceptionResponse;

/**
* Scope Interface
*
* Interface for scope
*
* @package kzarshenas/crazyphp
* @author kekefreedog <kevin.zarshenas@gmail.com>
* @copyright 2022-2024 Kévin Zarshenas
*/
class Database {

/**
* Constructor
*
* @param array $options
* @param self
*/
public function __construct(array $form, array $options = []) {



}

}
13 changes: 13 additions & 0 deletions src/Front/Library/Utility/DateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@ export default class DateTime {
return `${year}${month}${day}`;
}

/**
* Get Today Date YYYY-MM-DD
*
* @returns
*/
public static getTodayDateYYYY_MM_DD = ():string => {
const date = new Date();
const year = date.getFullYear().toString(); // Get last two digits of the year
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are 0-indexed, pad with zero
const day = date.getDate().toString().padStart(2, '0'); // Pad with zero if needed
return `${year}-${month}-${day}`;
}

/**
* Convert Date Fromat
*
Expand Down

0 comments on commit 1497d8f

Please sign in to comment.