2023-03-13 09:07:52 +00:00
|
|
|
import { boot } from 'quasar/wrappers';
|
|
|
|
|
|
|
|
export default boot(() => {
|
|
|
|
Date.vnUTC = () => {
|
|
|
|
const env = process.env.NODE_ENV;
|
|
|
|
if (!env || env === 'development') return new Date(Date.UTC(2001, 0, 1, 11));
|
|
|
|
|
|
|
|
return new Date();
|
|
|
|
};
|
|
|
|
|
|
|
|
Date.vnNew = () => {
|
|
|
|
return new Date(Date.vnUTC());
|
|
|
|
};
|
|
|
|
|
|
|
|
Date.vnNow = () => {
|
|
|
|
return new Date(Date.vnUTC()).getTime();
|
|
|
|
};
|
2023-12-13 13:19:42 +00:00
|
|
|
|
|
|
|
Date.vnFirstDayOfMonth = () => {
|
|
|
|
const date = new Date(Date.vnUTC());
|
|
|
|
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
|
|
};
|
|
|
|
|
|
|
|
Date.vnLastDayOfMonth = () => {
|
|
|
|
const date = new Date(Date.vnUTC());
|
|
|
|
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
|
|
};
|
2023-03-13 09:07:52 +00:00
|
|
|
});
|