-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: permitir filtro de produtos com horas
- Loading branch information
1 parent
0f3f8d4
commit 51581cf
Showing
3 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
/** | ||
* Converte um objeto `Date` para o formato `YYYY-MM-DD`. | ||
* Converte um objeto `Date` para o formato `YYYY-MM-DD` (opcionalmente `YYYY-MM-DD HH:MM:SS`). | ||
*/ | ||
export default (date: Date) => | ||
`${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` | ||
export default (date: Date, includeTime: boolean = false) => { | ||
const baseTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` | ||
if (!includeTime) return baseTime | ||
|
||
return `${baseTime} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}` | ||
} |