mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-16 21:46:32 +00:00
716d55a370
* Add German Translation * Fix visibility description * fix lint * Registries or Registry * Update web/src/assets/locales/de.json * Apply suggestions from code review Co-authored-by: Anbraten <anton@ju60.de> * Update web/src/assets/locales/de.json Co-authored-by: Anbraten <anton@ju60.de> * Update web/src/assets/locales/de.json Co-authored-by: Anbraten <anton@ju60.de>
26 lines
609 B
TypeScript
26 lines
609 B
TypeScript
import 'dayjs/locale/en';
|
|
import 'dayjs/locale/lv';
|
|
import 'dayjs/locale/de';
|
|
|
|
import dayjs from 'dayjs';
|
|
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
|
import timezone from 'dayjs/plugin/timezone';
|
|
import utc from 'dayjs/plugin/utc';
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
import { getUserLanguage } from '~/utils/locale';
|
|
|
|
dayjs.extend(timezone);
|
|
dayjs.extend(utc);
|
|
dayjs.extend(advancedFormat);
|
|
dayjs.locale(getUserLanguage());
|
|
|
|
export function useDate() {
|
|
function toLocaleString(date: Date) {
|
|
return dayjs(date).format(useI18n().t('time.tmpl'));
|
|
}
|
|
|
|
return {
|
|
toLocaleString,
|
|
};
|
|
}
|