mirror of
https://github.com/frappe/lms.git
synced 2026-04-22 16:28:00 +03:00
feat: rtl support for dates
This commit is contained in:
@@ -7,6 +7,10 @@ import isSameOrBefore from 'dayjs/esm/plugin/isSameOrBefore'
|
||||
import isSameOrAfter from 'dayjs/esm/plugin/isSameOrAfter'
|
||||
import utc from 'dayjs/esm/plugin/utc'
|
||||
import timezone from 'dayjs/esm/plugin/timezone'
|
||||
import 'dayjs/esm/locale/ar'
|
||||
import 'dayjs/esm/locale/he'
|
||||
import 'dayjs/esm/locale/fa'
|
||||
import 'dayjs/esm/locale/ur'
|
||||
|
||||
dayjs.extend(updateLocale)
|
||||
dayjs.extend(relativeTime)
|
||||
@@ -17,4 +21,11 @@ dayjs.extend(isSameOrAfter)
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
|
||||
if (
|
||||
document.documentElement.dir === 'rtl' &&
|
||||
['ar', 'he', 'fa', 'ur'].includes(window.lang)
|
||||
) {
|
||||
dayjs.locale(window.lang)
|
||||
}
|
||||
|
||||
export default dayjs
|
||||
|
||||
Reference in New Issue
Block a user