@@ -16,6 +16,7 @@ import { useNavigate } from "react-router-dom"; | |||||
import { notifyDownloadSuccess } from 'utils/CommonFunction'; | import { notifyDownloadSuccess } from 'utils/CommonFunction'; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
import { useIntl } from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -39,6 +40,9 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
const [issueCombo, setIssueCombo] = React.useState([]); | const [issueCombo, setIssueCombo] = React.useState([]); | ||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (issueComboData && issueComboData.length > 0) { | if (issueComboData && issueComboData.length > 0) { | ||||
setIssueCombo(issueComboData); | setIssueCombo(issueComboData); | ||||
@@ -58,11 +62,27 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
}, [issueSelected]); | }, [issueSelected]); | ||||
function getIssueLabel(data) { | function getIssueLabel(data) { | ||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
const onSubmit = () => { | const onSubmit = () => { | ||||
@@ -13,6 +13,7 @@ import * as DateUtils from "utils/DateUtils"; | |||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
import { useIntl } from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -34,6 +35,10 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
const [minDueDate, setMinDueDate] = React.useState(searchCriteria.dueDateFrom); | const [minDueDate, setMinDueDate] = React.useState(searchCriteria.dueDateFrom); | ||||
const [maxDueDate, setMaxDueDate] = React.useState(searchCriteria.dueDateTo); | const [maxDueDate, setMaxDueDate] = React.useState(searchCriteria.dueDateTo); | ||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
data.status = selectedLabelsString | data.status = selectedLabelsString | ||||
@@ -79,11 +84,27 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
} | } | ||||
function getIssueLabel(data) { | function getIssueLabel(data) { | ||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
return ( | return ( | ||||
@@ -20,7 +20,10 @@ import {ThemeProvider} from "@emotion/react"; | |||||
const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData | const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData | ||||
}) => { | }) => { | ||||
const intl = useIntl(); | const intl = useIntl(); | ||||
const { locale } = intl; | |||||
const [type, setType] = React.useState([]); | const [type, setType] = React.useState([]); | ||||
const [issueSelected, setIssueSelected] = React.useState({}); | const [issueSelected, setIssueSelected] = React.useState({}); | ||||
const [issueCombo, setIssueCombo] = React.useState([]); | const [issueCombo, setIssueCombo] = React.useState([]); | ||||
@@ -63,13 +66,28 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData | |||||
} | } | ||||
function getIssueLabel(data) { | function getIssueLabel(data) { | ||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
return ( | return ( | ||||
<MainCard xs={12} md={12} lg={12} | <MainCard xs={12} md={12} lg={12} | ||||
border={false} | border={false} | ||||
@@ -13,6 +13,7 @@ import * as FormatUtils from "utils/FormatUtils"; | |||||
import { Typography } from '../../../../node_modules/@mui/material/index'; | import { Typography } from '../../../../node_modules/@mui/material/index'; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
import { useIntl } from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -30,6 +31,9 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | ||||
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
const marginBottom = 2.5; | const marginBottom = 2.5; | ||||
const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
@@ -77,13 +81,30 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
} | } | ||||
function getIssueLabel(data) { | function getIssueLabel(data) { | ||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
return ( | return ( | ||||
<MainCard xs={12} md={12} lg={12} | <MainCard xs={12} md={12} lg={12} | ||||
border={false} | border={false} | ||||
@@ -21,6 +21,8 @@ import {FormattedMessage, useIntl} from "react-intl"; | |||||
const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData | const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData | ||||
}) => { | }) => { | ||||
const intl = useIntl(); | const intl = useIntl(); | ||||
const { locale } = intl; | |||||
const [type, setType] = React.useState([]); | const [type, setType] = React.useState([]); | ||||
const [status, setStatus] = React.useState(ComboData.proofStatus[0]); | const [status, setStatus] = React.useState(ComboData.proofStatus[0]); | ||||
const [issueSelected, setIssueSelected] = React.useState({}); | const [issueSelected, setIssueSelected] = React.useState({}); | ||||
@@ -84,11 +86,27 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData | |||||
} | } | ||||
function getIssueLabel(data) { | function getIssueLabel(data) { | ||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
return ( | return ( | ||||
@@ -27,10 +27,11 @@ import {FormattedMessage, useIntl} from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
const PublicNoticeApplyForm = ({ loadedData, _selections }) => { | |||||
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | ||||
const [warningText, setWarningText] = React.useState(""); | const [warningText, setWarningText] = React.useState(""); | ||||
const [attachment, setAttachment] = React.useState({}); | const [attachment, setAttachment] = React.useState({}); | ||||
const [selections, setsSelections] = React.useState(<></>); | |||||
const intl = useIntl(); | const intl = useIntl(); | ||||
const [val, setVal] = React.useState({}); | const [val, setVal] = React.useState({}); | ||||
@@ -57,6 +58,10 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}); | return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}); | ||||
} | } | ||||
React.useEffect(() => { | |||||
setsSelections(_selections) | |||||
}, [_selections]); | |||||
const formik = useFormik({ | const formik = useFormik({ | ||||
enableReinitialize: true, | enableReinitialize: true, | ||||
initialValues: loadedData, | initialValues: loadedData, | ||||
@@ -2,8 +2,9 @@ | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
import * as DateUtils from "utils/DateUtils"; | |||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import * as DateUtils from "utils/DateUtils"; | |||||
import { useIntl } from "react-intl"; | |||||
import { | import { | ||||
Grid, | Grid, | ||||
@@ -21,9 +22,14 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||||
const ApplyForm = () => { | const ApplyForm = () => { | ||||
const [userData, setUserData] = React.useState(null); | const [userData, setUserData] = React.useState(null); | ||||
const [gazetteIssueList, setGazetteIssueList] = React.useState([]); | |||||
const [selections, setSelection] = React.useState([]); | const [selections, setSelection] = React.useState([]); | ||||
const [isLoading, setLoding] = React.useState(true); | const [isLoading, setLoding] = React.useState(true); | ||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
loadUserData(); | loadUserData(); | ||||
}, []); | }, []); | ||||
@@ -43,22 +49,53 @@ const ApplyForm = () => { | |||||
var selection = []; | var selection = []; | ||||
for (var i = 0; i < response?.gazetteIssueList?.length; i++) { | for (var i = 0; i < response?.gazetteIssueList?.length; i++) { | ||||
let data = response.gazetteIssueList[i]; | let data = response.gazetteIssueList[i]; | ||||
let label = getIssueLabel(data); | |||||
selection.push(<FormControlLabel value={data.id} control={<Radio />} label={label} />); | |||||
//let label = getIssueLabel(data); | |||||
selection.push(<FormControlLabel value={data.id} control={<Radio />} label={getIssueLabel(data)} />); | |||||
} | } | ||||
setGazetteIssueList(response?.gazetteIssueList); | |||||
setSelection(selection); | setSelection(selection); | ||||
setUserData(response); | setUserData(response); | ||||
} | } | ||||
}); | }); | ||||
}; | }; | ||||
function getIssueLabel(data) { | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
React.useEffect(() => { | |||||
if(gazetteIssueList?.length>0){ | |||||
var selection = []; | |||||
for (var i = 0; i < gazetteIssueList?.length; i++) { | |||||
let data = gazetteIssueList[i]; | |||||
let label = getIssueLabel(data); | |||||
selection.push(<FormControlLabel value={data.id} control={<Radio />} label={label} />); | |||||
} | |||||
setSelection(selection); | |||||
} | |||||
}, [locale]); | |||||
const getIssueLabel=(data)=> { | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (userData !== null) setLoding(false); | if (userData !== null) setLoding(false); | ||||
}, [userData]); | }, [userData]); | ||||
@@ -73,7 +110,7 @@ const ApplyForm = () => { | |||||
: | : | ||||
<PublicNoticeApplyForm | <PublicNoticeApplyForm | ||||
loadedData={userData} | loadedData={userData} | ||||
selections={selections} | |||||
_selections={selections} | |||||
/> | /> | ||||
); | ); | ||||
}; | }; | ||||
@@ -11,8 +11,9 @@ import * as React from "react"; | |||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import {ThemeProvider} from "@emotion/react"; | |||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import { ThemeProvider } from "@emotion/react"; | |||||
import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst"; | |||||
import { useIntl } from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -31,6 +32,9 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); | ||||
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
const marginBottom = 2.5; | const marginBottom = 2.5; | ||||
const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
@@ -75,12 +79,28 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
reset(); | reset(); | ||||
} | } | ||||
function getIssueLabel(data) { | |||||
if (data == {}) return ""; | |||||
return data.issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||||
const getIssueLabel=(data)=> { | |||||
let issueYear = data.issueYear | |||||
let volume = data.volume; | |||||
let issueNo = data.issueNo; | |||||
let issueDate = data.issueDate; | |||||
if (locale === 'zh-HK') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_ZH(issueDate) + ")"; | |||||
} else if (locale === 'zh-CN') { | |||||
return issueYear | |||||
+ " 第" + volume + "卷," | |||||
+ " 第" + issueNo + "期," | |||||
+ " " + DateUtils.dateFormat(issueDate, "YYYY年MM月DD日") | |||||
+ " (" + DateUtils.getWeekdayStr_CN(issueDate) + ")"; | |||||
} | |||||
return issueYear | |||||
+ " Vol. " + FormatUtils.zeroPad(volume, 3) | |||||
+ ", No. " + FormatUtils.zeroPad(issueNo, 2) | |||||
+ ", " + DateUtils.dateFormat(issueDate, "D MMM YYYY (ddd)"); | |||||
} | } | ||||
return ( | return ( | ||||
@@ -91,9 +111,9 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1, mb: marginBottom}} width="98%"> | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1, mb: marginBottom }} width="98%"> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:marginBottom}}> | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{ mt: 1, ml: 3, mb: marginBottom }}> | |||||
<Typography variant="pnspsFormHeader" > | <Typography variant="pnspsFormHeader" > | ||||
Search | Search | ||||
</Typography> | </Typography> | ||||
@@ -113,7 +133,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
/> | /> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:marginBottom}}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: marginBottom }}> | |||||
<Grid container> | <Grid container> | ||||
<Grid item xs={5.25} s={5.25} md={5.25} lg={5.5}> | <Grid item xs={5.25} s={5.25} md={5.25} lg={5.5}> | ||||
<TextField | <TextField | ||||
@@ -133,7 +153,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
/> | /> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={1.5} s={1.5} md={1.5} lg={1} sx={{mt:0.8, display: 'flex', justifyContent:"center", alignItems: 'flex-start'}}> | |||||
<Grid item xs={1.5} s={1.5} md={1.5} lg={1} sx={{ mt: 0.8, display: 'flex', justifyContent: "center", alignItems: 'flex-start' }}> | |||||
To | To | ||||
</Grid> | </Grid> | ||||
@@ -301,23 +321,23 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
> | |||||
Clear | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
> | |||||
Clear | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
> | |||||
Submit | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
> | |||||
Submit | |||||
</Button> | |||||
</Grid> | |||||
</ThemeProvider> | </ThemeProvider> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -276,8 +276,7 @@ const CustomFormWizard = (props) => { | |||||
const { handleSubmit } = useForm({}) | const { handleSubmit } = useForm({}) | ||||
const _onSubmit = () => { | const _onSubmit = () => { | ||||
setLoding(true); | setLoding(true); | ||||
values.address4 = selectedAddress4 | |||||
values.address5 = selectedAddress5 | |||||
const userAddress = { | const userAddress = { | ||||
"addressLine1": "", | "addressLine1": "", | ||||
"addressLine2": "", | "addressLine2": "", | ||||
@@ -288,8 +287,8 @@ const CustomFormWizard = (props) => { | |||||
userAddress.addressLine1 = values.address1 | userAddress.addressLine1 = values.address1 | ||||
userAddress.addressLine2 = values.address2 | userAddress.addressLine2 = values.address2 | ||||
userAddress.addressLine3 = values.address3 | userAddress.addressLine3 = values.address3 | ||||
userAddress.district = values.address4 | |||||
userAddress.country = values.address5 | |||||
values.address4 = selectedAddress4 == null ? "" : selectedAddress4.key | |||||
values.address5 = selectedAddress5.key | |||||
const userFaxNo = { | const userFaxNo = { | ||||
"countryCode": values.faxCountryCode, | "countryCode": values.faxCountryCode, | ||||
@@ -1,5 +1,8 @@ | |||||
import dayjs from 'dayjs'; | import dayjs from 'dayjs'; | ||||
var days_ZH = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'] | |||||
var days_CN = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'] | |||||
export const datetimeStr = (date) =>{ | export const datetimeStr = (date) =>{ | ||||
return dateFormat(date,"YYYY-MM-DD HH:mm:ss") | return dateFormat(date,"YYYY-MM-DD HH:mm:ss") | ||||
@@ -51,3 +54,13 @@ export const dateFormat = (date, format) =>{ | |||||
date = convertToDate(date); | date = convertToDate(date); | ||||
return dayjs(date).format(format); | return dayjs(date).format(format); | ||||
}; | }; | ||||
export const getWeekdayStr_ZH = (date) =>{ | |||||
date = convertToDate(date); | |||||
return days_ZH[date.getDay()] | |||||
}; | |||||
export const getWeekdayStr_CN = (date) =>{ | |||||
date = convertToDate(date); | |||||
return days_CN[date.getDay()] | |||||
}; |
@@ -1,4 +1,5 @@ | |||||
export function currencyFormat(num) { | export function currencyFormat(num) { | ||||
let val = num ? num : 0; | let val = num ? num : 0; | ||||
return val.toLocaleString('en-US', { | return val.toLocaleString('en-US', { | ||||
@@ -15,3 +16,4 @@ export function zeroPad(num, places) { | |||||