diff --git a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js index 79bf2cf..5574dae 100644 --- a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js +++ b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js @@ -54,6 +54,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => const [issueId, setIssueId] = useState(loadedData.issueId); const [closeDate, setCloseDate] = useState(null); + const [paymentCloseDate, setPaymentCloseDate] = useState(null); const [closingDateOff, setClosingDateOff] = useState(null); const [isOnlyOnlinePayment, setOnlyOnlinePayment] = useState(); const navigate = useNavigate(); @@ -89,6 +90,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => let data = gazetteIssueList[i]; if (data.id == issueId) { setCloseDate(data.closingDate) + setPaymentCloseDate(data.paymentCloseDate) setClosingDateOff(data.closingDateOff) setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) @@ -410,7 +412,10 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => }}> {DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"2:00 p.m.":"下午2時"} - {DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"2:30 p.m.":"下午2時30分"} + + {DateUtils.dateFormat(paymentCloseDate, dft)}{" "} + {DateUtils.timeFormat(paymentCloseDate, locale)} + {!isOnlyOnlinePayment? <> diff --git a/src/pages/authentication/AuthWrapper.js b/src/pages/authentication/AuthWrapper.js index 7ccab39..a1b0b1b 100644 --- a/src/pages/authentication/AuthWrapper.js +++ b/src/pages/authentication/AuthWrapper.js @@ -20,12 +20,30 @@ const BackgroundHead = { }; const parseToDate = (v) => { - if (!v) return null; - if (/^\d{10,13}$/.test(String(v))) return new Date(Number(v)); - const d = new Date(String(v)); + if (v == null || v === "") return null; + + // timestamp: 10 digits (sec) or 13 digits (ms) + const s = String(v).trim(); + if (/^\d{10,13}$/.test(s)) { + const n = Number(s); + return new Date(s.length === 10 ? n * 1000 : n); + } + + // date-only: YYYY-MM-DD -> treat as LOCAL midnight + const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s); + if (m) { + const y = Number(m[1]); + const mo = Number(m[2]) - 1; // 0-based + const d = Number(m[3]); + return new Date(y, mo, d, 0, 0, 0, 0); + } + + // otherwise: ISO datetime or other formats + const d = new Date(s); return Number.isNaN(d.getTime()) ? null : d; }; + const AuthWrapper = ({ children }) => { const intl = useIntl(); const { sysSetting } = useContext(SysContext); diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index cf2a976..1f4fb05 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -99,7 +99,7 @@ const LoginRoutes = { element: }, { - path: 'userGuidePub1', + path: 'userguide-fi', element: }, { diff --git a/src/translations/en.json b/src/translations/en.json index 990cfd7..bd93e9c 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -13,7 +13,7 @@ "PNSPS_fullname": "Public Notice Submission and Payment System", "HKSARGOV": "The Government of the Hong Kong Special Administrative Region", "homePageHeaderMessage": "

The Gazette Public Notice Submission and Payment System (PNSPS) has been smoothly rolled out in August 2024 and will be fully implemented on 28 January 2026. Starting from 28 January 2026, applications for publication of public notice in the Government Gazette and payment of gazette fee must be made online via the PNSPS. FPS (轉數快), PPS (繳費靈) and credit card are available in the PNSPS for payment of gazette fee. Applications made by other means will be returned to the applicant for re-submission via the PNSPS.

We would like to invite all applicants for publishing public notices in the Gazette to get well prepared for the change early, register as PNSPS user now and submit online applications to experience the benefits of the new online platform.

If you have any enquiries on the set-up of the above online payment methods, please contact your bank (for FPS and credit card) or the PPS (PPS hotline: 2311 9876).

", - "homePageHeaderMessageFullImpl": "

The Gazette Public Notice Submission and Payment System (PNSPS) has been fully implemented on 28 January 2026. Starting from 28 January 2026, applications for publication of public notice in the Government Gazette and payment of gazette fee must be made online via the PNSPS. Applications made by other means will be returned to the applicant for re-submission via the PNSPS.

FPS (轉數快), PPS (繳費靈) and credit card are available in the PNSPS for payment of gazette fee. If you have any enquiries on the set-up of the online payment methods, please contact your bank (for FPS and credit card) or the PPS (PPS hotline: 2311 9876).

", + "homePageHeaderMessageFullImpl": "

The Gazette Public Notice Submission and Payment System (PNSPS) will be fully implemented on 28 January 2026 and all applications and payment for publishing public notices on the Government Gazette must be made online via the PNSPS from 28 January 2026 onwards.

Applications made by other means will be returned to the applicant for re-submission via the PNSPS.

", "HKGLD": "Government Logistics Department", "importantNotice": "Important Notice", "privacyPolicy": "Privacy Policy", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 64bbc4e..3d7602f 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -13,7 +13,7 @@ "PNSPS_fullname": "公共啟事提交及繳費系統", "HKSARGOV": "香港特別行政區政府", "homePageHeaderMessage": "

憲報公共啟事提交及繳費系統」已於2024年8月順利啟用,並將於2026年1月28日全面推行。由2026年1月28日開始,所有申請人必須使用網上「憲報公共啟事提交及繳費系統」提交公共啟事申請及繳交相關費用,申請人可以選擇轉數快(FPS)、 繳費靈(PPS)和信用卡繳交費用。以其他方式提交的申請將退回給申請人,重新透過系統提交。

現誠邀所有刊登憲報公共啟事申請人及早為新安排做好準備,立即登記成為系統用戶,使用系統提交申請,以體驗新平台的便捷。

如果你對上述網上付款方式的設定有任何查詢,請聯絡你的銀行(轉數快及信用卡)或繳費靈(繳費靈熱線:2311 9876)。

", - "homePageHeaderMessageFullImpl": "

「憲報公共啟事提交及繳費系統」已於2026年1月28日全面推行。由2026年1月28日開始,所有申請人必須使用網上「憲報公共啟事提交及繳費系統」提交公共啟事申請及繳交相關費用。以其他方式提交的申請將退回給申請人,重新透過系統提交。

申請人可以選擇轉數快(FPS)、 繳費靈(PPS)和信用卡繳交費用。如果你對網上付款方式的設定有任何查詢,請聯絡你的銀行(轉數快及信用卡)或繳費靈(繳費靈熱線:2311 9876)。

", + "homePageHeaderMessageFullImpl": "

宪报公共启事提交及缴费系统」(系统)将于2026年1月28日全面推行。由2026年1月28日开始,所有申请人必须使用系统提交公共启事申请及缴交相关费用。

以其他方式提交的申请将退回给申请人,重新透过系统提交。

", "HKGLD": "政府物流服務署", "importantNotice": "重要告示", "privacyPolicy": "私隱政策", diff --git a/src/utils/DateUtils.js b/src/utils/DateUtils.js index 5e36f1e..0405063 100644 --- a/src/utils/DateUtils.js +++ b/src/utils/DateUtils.js @@ -37,6 +37,41 @@ export const datetimeFieldFormat = (date) =>{ return dateFormat(date,"YYYY-MM-DDTHH:mm"); }; +export const timeFormat = (date, locale) => { + if (!date) return ""; + + let d; + + if (Array.isArray(date)) { + const [y, m, d1, h = 0, min = 0, s = 0] = date; + d = dayjs(new Date(y, m - 1, d1, h, min, s)); + } else { + d = dayjs(date); + } + + if (!d.isValid()) return ""; + + const hour = d.hour(); + const minute = d.minute(); + + if (locale === "en") { + return minute === 0 + ? d.format("h a") + : d.format("h:mm a"); + } + + // 中文顯示(香港慣用) + const period = hour < 12 ? "上午" : "下午"; + + if (minute === 0) { + return `${period}${d.format("h時")}`; + } + + return `${period}${d.format("h時mm分")}`; +}; + + + export const convertToDate = (date)=>{ if(typeof date == 'number'){ return dayjs(date).toDate();