fix: handle same start and end dates case for batch
* also minor refactor
This commit is contained in:
@@ -8,6 +8,7 @@ import Paragraph from '@editorjs/paragraph'
|
||||
import Embed from '@editorjs/embed'
|
||||
import NestedList from '@editorjs/nested-list'
|
||||
import { watch } from 'vue'
|
||||
import dayjs from '@/utils/dayjs'
|
||||
|
||||
export function createToast(options) {
|
||||
toast({
|
||||
@@ -322,3 +323,12 @@ export function getSidebarLinks() {
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export function getFormattedDateRange(startDate, endDate) {
|
||||
if (startDate === endDate) {
|
||||
return dayjs(startDate).format('DD MMM YYYY')
|
||||
}
|
||||
return `${dayjs(startDate).format('DD MMM YYYY')} - ${dayjs(endDate).format(
|
||||
'DD MMM YYYY'
|
||||
)}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user