This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): date format utils (#1060)
* feat(datepicker): date format utils * feat(datepicker): test styles fix issue * feat(datepicker): exported format utils * feat(datepicker): rollback to scoped styles * feat(datepicker): date format doc and package update --------- Co-authored-by: iropolo <ignacio.ropolo@dialpad.com>
- Loading branch information
Showing
6 changed files
with
112 additions
and
3,312 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { format } from 'date-fns'; | ||
|
||
export function formatLong (date) { | ||
return format(date, 'EEEE, MMMM d, yyyy'); | ||
} | ||
|
||
export function formatMedium (date) { | ||
return format(date, 'MMMM d, yyyy'); | ||
} | ||
|
||
export function formatShort (date, showWeekday = true) { | ||
const formatString = showWeekday ? 'EEE, MMM d, yyyy' : 'MMM d, yyyy'; | ||
return format(date, formatString); | ||
} | ||
|
||
export function formatNoYear (date, abbreviated = false) { | ||
const formatString = abbreviated ? 'MMM d' : 'MMMM d'; | ||
return format(date, formatString); | ||
} | ||
|
||
export function formatNumerical (date) { | ||
return format(date, 'MM/dd/yy'); | ||
} |
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,2 +1,2 @@ | ||
export { default as DtDatepicker } from './DtDatepicker.vue'; | ||
export {} from './datepicker_constants'; | ||
export * from './formatUtils.js'; |
Oops, something went wrong.