TP-41367 | Map view min date validation added (#681)
* TP-41367 | Boiler plate * TP-41367 | mock data and redux actions and slices added * TP-41367 | Agent Map View V2 * TP-41367 | Clickstream Added + Bug Fixes * TP-41367 | Code Refactored * TP-41367 | Code Refactored * TP-41367 | Oin Scaling Added + Fix Bugs * TP-41367 | totalOverdue Amount Fix * TP-41367 | Bug Fixes * TP-41367 | UAT Fixes * TP-41367 | File name change + code refactored * TP-41367 | fixes * TP-41367 | eslint fixes * TP-41367 | prettier fixes * TP-41367 | fixes * TP-41367 | fixes and design changes * TP-41367 | Popup FIx * TP-41367 | Map View Fix * TP-41367 | UAT Fixes * TP-41367 | Minor Fixes * TP-41367 | comments resolved * TP-41367 | colors added to tailwind * TP-41367 | comment fixes * TP-41367 | fixes * TP-41367 | Color change * TP-41367 | min date change added --------- Co-authored-by: yashmantri <mantri.ramkishor@navi.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { RootState } from 'src/store';
|
||||
import { DateFormat } from 'src/utils/DateHelper';
|
||||
import { createQueryParams, readQueryParams } from 'src/utils/QueryParamsHelper';
|
||||
import { AGENT_LIVE_LOCATION, MarkerInfoList } from '../../constants/LiveLocatonTrackerConstants';
|
||||
import { getAgentDetails, getMaxInputDate } from '../../utils';
|
||||
import { getAgentDetails, getMaxInputDate, getMinInputDate } from '../../utils';
|
||||
import AgentDetail from './AgentDetail';
|
||||
import FeedbackDetail from './FeedbackDetail';
|
||||
import styles from './index.module.scss';
|
||||
@@ -37,6 +37,7 @@ const AccordionBody = () => {
|
||||
const { [AGENT_LIVE_LOCATION]: queryParams = {} } = readQueryParams();
|
||||
|
||||
const maxInputDate = getMaxInputDate(DateFormat.ISO_DATE_FORMAT);
|
||||
const minInputDate = getMinInputDate(DateFormat.ISO_DATE_FORMAT);
|
||||
|
||||
useEffect(() => {
|
||||
if (polylineRef.current) {
|
||||
@@ -125,6 +126,7 @@ const AccordionBody = () => {
|
||||
fullWidth
|
||||
required
|
||||
max={maxInputDate}
|
||||
min={minInputDate}
|
||||
value={queryParams?.DATE ?? maxInputDate}
|
||||
onChange={dateChangeHandler}
|
||||
onClick={() => {
|
||||
|
||||
@@ -123,6 +123,11 @@ export const getMaxInputDate = (format: string) => {
|
||||
return dayjs().format(format);
|
||||
};
|
||||
|
||||
// start of the month
|
||||
export const getMinInputDate = (format: string) => {
|
||||
return dayjs().startOf('month').format(format);
|
||||
};
|
||||
|
||||
export const getAgentDetails =
|
||||
(payload: AgentDetailsPayload, navigate: NavigateFunction) => (dispatch: any) => {
|
||||
const { [AGENT_LIVE_LOCATION]: queryParams = {} } = readQueryParams();
|
||||
|
||||
Reference in New Issue
Block a user