diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index a3762d5..c7473f9 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -24,7 +24,7 @@ import { useNavigate } from "react-router-dom"; import { isORGLoggedIn, } from "utils/Utils"; -import { dateStr } from "utils/DateUtils"; +// import { dateStr } from "utils/DateUtils"; import { ThemeProvider, useTheme } from "@emotion/react"; import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst"; import { FormattedMessage, useIntl } from "react-intl"; @@ -48,6 +48,7 @@ export default function SubmittedTab({ setCount, url }) { const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); const intl = useIntl(); + const { locale } = intl; //const [amount, setAmount] = React.useState(0); const navigate = useNavigate() @@ -225,10 +226,33 @@ export default function SubmittedTab({ setCount, url }) {

- {dateStr(params.row.closingDateOff)} - {params.row.paymentMethod=="online" ? " 2:00pm" + {/* {dateStr(params.row.closingDate)} */} + { + params.row.paymentMethod=="online"? + locale === 'en' ? + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}` + : + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` + :params.row.paymentMethod=="demandNote" ? + locale === 'en' ? + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "a.m.")?.replace("pm", "p.m.")}` + : + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` + : + locale === 'en' ? + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}` + : + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` + } + {/* { + locale === 'en' ? + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}` + : + `${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` + } + {params.row.paymentMethod=="online" ? " 2:30pm" :params.row.paymentMethod=="demandNote" ? " 12:00pm" - : " 12:30pm"} + : " 12:30pm"} */}
) diff --git a/src/pages/extra-pages/UserMenuPub/index.js b/src/pages/extra-pages/UserMenuPub/index.js index 8664050..10f4332 100644 --- a/src/pages/extra-pages/UserMenuPub/index.js +++ b/src/pages/extra-pages/UserMenuPub/index.js @@ -90,102 +90,102 @@ const UserMenu = () => { {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/01 - Account Activation.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/01c - Account Activation.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/01sc - Account Activation.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/01 - Account Activation.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/01c - Account Activation.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/01sc - Account Activation.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/01 - Account Activation.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/01c - Account Activation.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/01sc - Account Activation.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/01 - Account Activation.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/01c - Account Activation.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/01sc - Account Activation.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/02 - Login.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/02c - Login.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/02sc - Login.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/02 - Login.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/02c - Login.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/02sc - Login.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/02 - Login.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/02c - Login.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/02sc - Login.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/02 - Login.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/02c - Login.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/02sc - Login.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/03 - Application for publishing a Public Notice in the Gazette.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/03c - Application for publishing a Public Notice in the Gazette.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/03sc - Application for publishing a Public Notice in the Gazette.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/03 - Application for publishing a Public Notice in the Gazette.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/03c - Application for publishing a Public Notice in the Gazette.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/03sc - Application for publishing a Public Notice in the Gazette.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/03 - Application for publishing a Public Notice in the Gazette.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/03c - Application for publishing a Public Notice in the Gazette.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/03sc - Application for publishing a Public Notice in the Gazette.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/03 - Application for publishing a Public Notice in the Gazette.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/03c - Application for publishing a Public Notice in the Gazette.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/03sc - Application for publishing a Public Notice in the Gazette.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/04 - Proofreading reply (with correction).pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/04c - Proofreading reply (with correction).pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/04sc - Proofreading reply (with correction).pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/04 - Proofreading reply (with correction).pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/04c - Proofreading reply (with correction).pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/04sc - Proofreading reply (with correction).pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/04 - Proofreading reply (with correction).pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/04c - Proofreading reply (with correction).pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/04sc - Proofreading reply (with correction).pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/04 - Proofreading reply (with correction).pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/04c - Proofreading reply (with correction).pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/04sc - Proofreading reply (with correction).pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/05 - Proofreading reply (pass for printing).pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/05c - Proofreading reply (pass for printing).pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/05sc - Proofreading reply (pass for printing).pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/05 - Proofreading reply (pass for printing).pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/05c - Proofreading reply (pass for printing).pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/05sc - Proofreading reply (pass for printing).pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/05 - Proofreading reply (pass for printing).pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/05c - Proofreading reply (pass for printing).pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/05sc - Proofreading reply (pass for printing).pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/05 - Proofreading reply (pass for printing).pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/05c - Proofreading reply (pass for printing).pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/05sc - Proofreading reply (pass for printing).pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/06 - Cancellation of application for publishing a Public Notice in the Gazette.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/06c - Cancellation of application for publishing a Public Notice in the Gazette.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/06sc - Cancellation of application for publishing a Public Notice in the Gazette.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/06 - Cancellation of application for publishing a Public Notice in the Gazette.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/06c - Cancellation of application for publishing a Public Notice in the Gazette.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/06sc - Cancellation of application for publishing a Public Notice in the Gazette.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/06 - Cancellation of application for publishing a Public Notice in the Gazette.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/06c - Cancellation of application for publishing a Public Notice in the Gazette.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/06sc - Cancellation of application for publishing a Public Notice in the Gazette.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/06 - Cancellation of application for publishing a Public Notice in the Gazette.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/06c - Cancellation of application for publishing a Public Notice in the Gazette.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/06sc - Cancellation of application for publishing a Public Notice in the Gazette.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/07 - Forgot password.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/07c - Forgot password.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/07sc - Forgot password.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/07 - Forgot password.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/07c - Forgot password.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/07sc - Forgot password.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/07 - Forgot password.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/07c - Forgot password.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/07sc - Forgot password.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/07 - Forgot password.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/07c - Forgot password.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/07sc - Forgot password.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/08 - Change password.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/08c - Change password.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/08sc - Change password.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/08 - Change password.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/08c - Change password.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/08sc - Change password.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/08 - Change password.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/08c - Change password.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/08sc - Change password.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/08 - Change password.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/08c - Change password.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/08sc - Change password.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/09 - Language of email notification.pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/09c - Language of email notification.pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/09sc - Language of email notification.pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/09 - Language of email notification.pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/09c - Language of email notification.pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/09sc - Language of email notification.pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/09 - Language of email notification.pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/09c - Language of email notification.pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/09sc - Language of email notification.pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/09 - Language of email notification.pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/09c - Language of email notification.pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/09sc - Language of email notification.pdf" })} {getRow({ title: , - orgEn: "https://pnsps.gld.gov.hk/user-guide/eng/10 - Download General Demand Note for making payment(s).pdf", - orgZh: "https://pnsps.gld.gov.hk/user-guide/cht/10c - Download General Demand Note for making payment(s).pdf", - orgCn: "https://pnsps.gld.gov.hk/user-guide/chs/10sc - Download General Demand Note for making payment(s).pdf", - indEn: "https://pnsps.gld.gov.hk/user-guide/eng/10 - Download General Demand Note for making payment(s).pdf", - indZh: "https://pnsps.gld.gov.hk/user-guide/cht/10c - Download General Demand Note for making payment(s).pdf", - indCn: "https://pnsps.gld.gov.hk/user-guide/chs/10sc - Download General Demand Note for making payment(s).pdf" + orgEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/10 - Download General Demand Note for making payment(s).pdf", + orgZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/10c - Download General Demand Note for making payment(s).pdf", + orgCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/10sc - Download General Demand Note for making payment(s).pdf", + indEn: "https://pnsps.gld.gov.hk/user-guide-pub/eng/10 - Download General Demand Note for making payment(s).pdf", + indZh: "https://pnsps.gld.gov.hk/user-guide-pub/cht/10c - Download General Demand Note for making payment(s).pdf", + indCn: "https://pnsps.gld.gov.hk/user-guide-pub/chs/10sc - Download General Demand Note for making payment(s).pdf" })} diff --git a/src/utils/DateUtils.js b/src/utils/DateUtils.js index d095ee4..dc78c95 100644 --- a/src/utils/DateUtils.js +++ b/src/utils/DateUtils.js @@ -65,6 +65,14 @@ export const dateFormat = (date, format) =>{ return ""; }; +export const dateFormatWithFix = (date, format, hours, minutes) =>{ + date = convertToDate(date); + date.setHours(hours); + date.setMinutes(minutes); + if(date) return dayjs(date).format(format); + return ""; +}; + export const getWeekdayStr_ZH = (date) =>{ date = convertToDate(date); if(date) return days_ZH[date.getDay()]