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

Today button #351

Open
2 of 3 tasks
xFrenchGamer73 opened this issue Dec 25, 2024 · 0 comments
Open
2 of 3 tasks

Today button #351

xFrenchGamer73 opened this issue Dec 25, 2024 · 0 comments

Comments

@xFrenchGamer73
Copy link

xFrenchGamer73 commented Dec 25, 2024

Your issue may already be reported!
Please search on the issue track before creating one.

  • Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • Are you running the latest version?
  • Are you reporting to the correct repository?

Bug Report

Environment

  • Extension version(s): 7.1.1
  • Bulma version: 1.0.2
  • OS: W11
  • Browser: Chrome,Edge,Arc
  • How you are customizing the extension: no

Current Behavior
When used in range mode, the today button works on the start date but when used on the end date, the date value is not returned

const calendars = bulmaCalendar.attach('[type="date"]', {
    lang: "fr",
    isRange: true,
    showHeader: false,
    dateFormat: "dd/MM/yyyy",
    cancelLabel: 'Annuler',
    clearLabel: 'Effacer',
    validateLabel: 'Valider',
    todayLabel: 'Aujourd\'hui',
    labelFrom: 'De',
    labelTo: 'à',
  });

  const specificElement = document.querySelector("#inputDate");
  if (specificElement && specificElement.bulmaCalendar) {
    specificElement.bulmaCalendar.on("select", (datepicker) => {
      const selectedRange = datepicker.data.value(); 
      logError(selectedRange);
      if (selectedRange) {
        const [startDate, endDate] = selectedRange.split(" - "); 
        if (startDate && endDate) {
          getElement("startDate").value = startDate.trim();
          getElement("endDate").value = endDate.trim();
          applyFilters();
        }
      }
    });
    specificElement.bulmaCalendar.on("clear", () => {
      getElement("startDate").value = "";
      getElement("endDate").value = "";
      applyFilters();
    });
  }

Possible Solution
I think it's an event issue, when we press the today button, the value should be assigned (const selectedRange = datepicker.data.value();
logError(selectedRange);) returns nothing

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

1 participant