mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-20 22:22:16 +01:00
add formatting support for months grouping
This commit is contained in:
@@ -245,6 +245,15 @@ export function formatWeekRange(date: string, format?: DateFormat): string {
|
||||
return `${formatDate(date, format)} - ${formatDate(end, format)}`;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the month that the given key falls in. There is no `DateFormat` variant for a
|
||||
* month, so this is not affected by the organization date format.
|
||||
* @param date - a month, in the format of 'YYYY-MM'
|
||||
*/
|
||||
export function formatMonth(date: string): string {
|
||||
return getDayJsInstance()(date).format('MMMM YYYY');
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a human readable date format.
|
||||
* @param date - date in the format of 'YYYY-MM-DD'
|
||||
|
||||
Reference in New Issue
Block a user