Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m21s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m21s
This commit is contained in:
commit
d00d4ac692
1 changed files with 11 additions and 13 deletions
|
|
@ -14,7 +14,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
const calAge = (
|
const calAge = (
|
||||||
srcDate: Date,
|
srcDate: Date,
|
||||||
birthCal: Date = new Date(),
|
birthCal: Date = new Date(),
|
||||||
eng: boolean = false
|
eng: boolean = false,
|
||||||
) => {
|
) => {
|
||||||
const year = eng ? "years" : "ปี";
|
const year = eng ? "years" : "ปี";
|
||||||
const month = eng ? "months" : "เดือน";
|
const month = eng ? "months" : "เดือน";
|
||||||
|
|
@ -82,7 +82,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
function date2Thai(
|
function date2Thai(
|
||||||
srcDate: Date | null,
|
srcDate: Date | null,
|
||||||
isFullMonth: boolean = false,
|
isFullMonth: boolean = false,
|
||||||
isTime: boolean = false
|
isTime: boolean = false,
|
||||||
) {
|
) {
|
||||||
if (srcDate == null || !moment(srcDate).isValid()) return "";
|
if (srcDate == null || !moment(srcDate).isValid()) return "";
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
function dateThai(
|
function dateThai(
|
||||||
srcDate: Date,
|
srcDate: Date,
|
||||||
isFullMonth: boolean = true,
|
isFullMonth: boolean = true,
|
||||||
isTime: boolean = false
|
isTime: boolean = false,
|
||||||
) {
|
) {
|
||||||
if (srcDate == null) {
|
if (srcDate == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -490,7 +490,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
color: string | undefined,
|
color: string | undefined,
|
||||||
ok?: Function | undefined,
|
ok?: Function | undefined,
|
||||||
cancel?: Function | undefined,
|
cancel?: Function | undefined,
|
||||||
onlycancel: Boolean = false
|
onlycancel: Boolean = false,
|
||||||
) => {
|
) => {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
component: CustomComponent,
|
component: CustomComponent,
|
||||||
|
|
@ -529,7 +529,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
title: string,
|
title: string,
|
||||||
message: string,
|
message: string,
|
||||||
ok: Function,
|
ok: Function,
|
||||||
cancel?: Function
|
cancel?: Function,
|
||||||
) {
|
) {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
title: `<span class="text-red">${title}</span>`,
|
title: `<span class="text-red">${title}</span>`,
|
||||||
|
|
@ -559,7 +559,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
title: string,
|
title: string,
|
||||||
message: string,
|
message: string,
|
||||||
ok: Function,
|
ok: Function,
|
||||||
cancel?: Function
|
cancel?: Function,
|
||||||
) {
|
) {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
title: `<span class="text-primary">${title}</span>`,
|
title: `<span class="text-primary">${title}</span>`,
|
||||||
|
|
@ -795,7 +795,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
ok?: Function,
|
ok?: Function,
|
||||||
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||||
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||||
cancel?: Function
|
cancel?: Function,
|
||||||
) => {
|
) => {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
component: CustomComponent,
|
component: CustomComponent,
|
||||||
|
|
@ -824,7 +824,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
ok?: Function,
|
ok?: Function,
|
||||||
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
title?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||||
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||||
cancel?: Function
|
cancel?: Function,
|
||||||
) => {
|
) => {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
component: CustomComponent,
|
component: CustomComponent,
|
||||||
|
|
@ -851,7 +851,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
const dialogMessageNotify = (
|
const dialogMessageNotify = (
|
||||||
q: any,
|
q: any,
|
||||||
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
desc?: string, // ถ้ามี cancel action ใส่เป็น null
|
||||||
cancel?: Function
|
cancel?: Function,
|
||||||
) => {
|
) => {
|
||||||
q.dialog({
|
q.dialog({
|
||||||
component: CustomComponent,
|
component: CustomComponent,
|
||||||
|
|
@ -973,7 +973,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
* @returns ผลการคำนวน ปี เดือน วัน ในรูปแบบ 1 ปี 10 เดือน 5 วัน
|
* @returns ผลการคำนวน ปี เดือน วัน ในรูปแบบ 1 ปี 10 เดือน 5 วัน
|
||||||
*/
|
*/
|
||||||
function calculateDurationYmd(startDate: any, endDate: any) {
|
function calculateDurationYmd(startDate: any, endDate: any) {
|
||||||
if (!startDate || !endDate) return "";
|
if (!startDate || !endDate) return "";
|
||||||
|
|
||||||
let start = moment(startDate).startOf("day");
|
let start = moment(startDate).startOf("day");
|
||||||
let end = moment(endDate).startOf("day").add(1, "day");
|
let end = moment(endDate).startOf("day").add(1, "day");
|
||||||
|
|
@ -1252,9 +1252,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
|
|
||||||
// กรณีมีเฉพาะ date
|
// กรณีมีเฉพาะ date
|
||||||
function convertDateToAPI(date: Date | null) {
|
function convertDateToAPI(date: Date | null) {
|
||||||
return date
|
return date ? format(date, "yyyy-MM-dd") : null;
|
||||||
? format(utcToZonedTime(date, "Asia/Bangkok"), "yyyy-MM-dd")
|
|
||||||
: null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// กรณี datetime
|
// กรณี datetime
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue