pull/170/head^2
parent
efb850693e
commit
ee0432fc09
|
@ -42,6 +42,7 @@
|
|||
const [register, { closeModal }] = useModalInner();
|
||||
|
||||
const [registerForm, { validateFields, resetFields }] = useForm({
|
||||
labelWidth: 100,
|
||||
showActionButtonGroup: false,
|
||||
schemas: [
|
||||
{
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
*/
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
|
||||
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
||||
const DATE_FORMAT = 'YYYY-MM-DD';
|
||||
|
||||
//TODO dayjs.ConfigType不知是否用对
|
||||
export function formatToDateTime(date: dayjs.ConfigType = undefined, format = DATE_TIME_FORMAT): string {
|
||||
export function formatToDateTime(date: dayjs.Dayjs | undefined = undefined, format = DATE_TIME_FORMAT): string {
|
||||
return dayjs(date).format(format);
|
||||
}
|
||||
|
||||
export function formatToDate(date: dayjs.ConfigType = undefined, format = DATE_FORMAT): string {
|
||||
export function formatToDate(date: dayjs.Dayjs | undefined = undefined, format = DATE_FORMAT): string {
|
||||
return dayjs(date).format(format);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
import { reactive, toRefs } from 'vue';
|
||||
import { useLocaleStore } from '/@/store/modules/locale';
|
||||
import { tryOnMounted, tryOnUnmounted } from '@vueuse/core';
|
||||
|
||||
export function useNow(immediate = true) {
|
||||
const localeStore = useLocaleStore();
|
||||
const localData = dateUtil.localeData(localeStore.getLocale);
|
||||
let timer: IntervalHandle;
|
||||
|
||||
const state = reactive({
|
||||
|
@ -28,13 +25,13 @@ export function useNow(immediate = true) {
|
|||
|
||||
state.year = now.get('y');
|
||||
state.month = now.get('M') + 1;
|
||||
state.week = localData.weekdays()[now.day()];
|
||||
state.day = now.get('D');
|
||||
state.week = '星期' + ['日', '一', '二', '三', '四', '五', '六'][now.day()];
|
||||
state.day = now.get('date');
|
||||
state.hour = h;
|
||||
state.minute = m;
|
||||
state.second = s;
|
||||
|
||||
state.meridiem = localData.meridiem(Number(h), Number(h), true);
|
||||
state.meridiem = now.format('A');
|
||||
};
|
||||
|
||||
function start() {
|
||||
|
|
Loading…
Reference in New Issue