#8370: Change year param rely on month #1326

Merged
jon merged 4 commits from 8370-WorkerTimeControl into dev 2025-03-04 14:00:40 +00:00
Member

Necesita el back: verdnatura/salix#3413

Necesita el back: https://gitea.verdnatura.es/verdnatura/salix/pulls/3413
jon added 1 commit 2025-02-03 15:21:00 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
ce5c21f4fa
fix: refs #8370 change param rely on month
jon requested review from alexm 2025-02-03 15:22:54 +00:00
alexm requested changes 2025-02-07 07:50:42 +00:00
Dismissed
alexm left a comment
Member

Me sale raro:
image

Me sale raro: ![image](/attachments/1c3fb168-707f-4ea3-850e-d27a375da225)
@ -345,17 +345,35 @@ const getMailStates = async (date) => {
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
Member

https://chatgpt.com/c/67a5bac7-c6cc-8011-be56-bf2ac23df374

const getMailStates = async (date) => {
    const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
    const year = date.getFullYear();
    const month = date.getMonth() + 1;

    const getMonthStates = async (month, year) => {
        return (await axios.get(url, { params: { month, year } })).data;
    };

    const curMonthStates = await getMonthStates(month, year);
    const prevMonthStates = await getMonthStates(month === 1 ? 12 : month - 1, month === 1 ? year - 1 : year);
    const postMonthStates = await getMonthStates(month === 12 ? 1 : month + 1, month === 12 ? year + 1 : year);

    workerTimeControlMails.value = [...curMonthStates, ...prevMonthStates, ...postMonthStates];
};

https://chatgpt.com/c/67a5bac7-c6cc-8011-be56-bf2ac23df374 ``` const getMailStates = async (date) => { const url = `WorkerTimeControls/${route.params.id}/getMailStates`; const year = date.getFullYear(); const month = date.getMonth() + 1; const getMonthStates = async (month, year) => { return (await axios.get(url, { params: { month, year } })).data; }; const curMonthStates = await getMonthStates(month, year); const prevMonthStates = await getMonthStates(month === 1 ? 12 : month - 1, month === 1 ? year - 1 : year); const postMonthStates = await getMonthStates(month === 12 ? 1 : month + 1, month === 12 ? year + 1 : year); workerTimeControlMails.value = [...curMonthStates, ...prevMonthStates, ...postMonthStates]; }; ```
alexm marked this conversation as resolved
jon added 1 commit 2025-03-04 10:21:51 +00:00
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
4e5a698e94
refactor: refs #8370 modified function to get the correct date
jon added 1 commit 2025-03-04 10:27:02 +00:00
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
50e3669655
Merge branch 'dev' into 8370-WorkerTimeControl
jon requested review from alexm 2025-03-04 10:28:25 +00:00
alexm added 1 commit 2025-03-04 12:33:20 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
cf82a04942
Merge branch 'dev' into 8370-WorkerTimeControl
alexm approved these changes 2025-03-04 12:33:43 +00:00
jon scheduled this pull request to auto merge when all checks succeed 2025-03-04 12:51:12 +00:00
jon merged commit 57de2466c2 into dev 2025-03-04 14:00:40 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix-front#1326
No description provided.