Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Wrong date selected in DatePicker


I'm trying to use the Metronic DatePicker component with the following configuration:


<div class="kt-form-item">
<label asp-for="DataNascimento2" class="kt-form-label"></label>
<div class="kt-form-control">
<input asp-for="DataNascimento2"
class="kt-input"
type="text"
data-kt-date-picker="true"
data-kt-date-picker-locale="pt-BR"
data-kt-date-picker-date-format="DD/MM/YYYY"
data-kt-date-picker-input-mode="true" />
</div>
<span asp-validation-for="DataNascimento2" class="text-xs text-destructive block"></span>
</div>


I'm using Metronic 9.4.12 (Tailwind version) and the DatePicker component as documented.

The DatePicker is configured to use the `pt-BR` locale and display dates in the `DD/MM/YYYY` format. However, when I select a date from the calendar, the value displayed in the input is always one day earlier than the date I selected.

For example:

* Selecting 06/06 displays 05/06.
* Selecting 07/06 displays 06/06.

The issue seems to occur only when using the `data-kt-date-picker-date-format="DD/MM/YYYY"` attribute.

I also noticed that the same behavior can be reproduced in the DatePicker examples from the official documentation.

Has anyone experienced this issue? Is there a known fix, workaround, or additional configuration required to prevent this behavior?

Additional information:

* Metronic version: 9.4.12
* Tailwind version
* Locale: pt-BR
* Custom date format: DD/MM/YYYY
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (0)