Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I change the due date from 12.00 pm to 6 p.m. #669

Open
anothaiyoyo opened this issue Apr 4, 2024 · 1 comment
Open

How can I change the due date from 12.00 pm to 6 p.m. #669

anothaiyoyo opened this issue Apr 4, 2024 · 1 comment

Comments

@anothaiyoyo
Copy link

anothaiyoyo commented Apr 4, 2024

Hello , How can I manually change the due date from 12.00 pm to 6 p.m. from the card list it has so many card that users working on they're not comfortable to change due date on every card , is it has any solution for do the manually change the time from 12p.m. to 6 p.m. ? , I trying to change from DueDateEditStep.jsx but it's not change though .
Screenshot_1

also it would be great if the due date can change the color from time to time if it nearly due date like from orange to red if we not checking that it's done .

Thank you !

@meltyshev
Copy link
Member

Hi! We don't have a way to change a due date for all cards in the list yet, but you can try opening your browser console (F12 in Chrome) and running this script:

const CARD_ID = '1234567890'; // <- ID of any card in the needed list (you can open a card and take it from the URL)
const DUE_DATE = '2025-01-01T10:00:00.000Z'; // <- needed due date in UTC

const getCookie = (name) => {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}

const cardElement = document.querySelector(`[data-rbd-draggable-id="card:${CARD_ID}"]`);
const accessToken = getCookie('accessToken');

for (const child of cardElement.parentElement.children) {
  if (child.dataset.rbdDraggableId) {
    const cardId = child.dataset.rbdDraggableId.split(':')[1];

    fetch(`${window.BASE_URL}/api/cards/${cardId}`, {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${getCookie('accessToken')}`,
      },
      body: JSON.stringify({ dueDate: DUE_DATE }),
    });
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants