Skip to content

Change format of whenDeleted to YYYY-MM-DD HH:MM:SS #4

Closed

Description

@rschouten97

The whenDeleted field in the blacklist table is currently mapped to use the date format DD-MM-YYYY HH:MM:SS (e.g., 31-3-2025 14:54:49). This format is causing issues with date conversion. The correct format should be YYYY-MM-DD HH:MM:SS (e.g., 2025-03-31 14:54:49).

Steps to Reproduce:

  1. Update the whenDeleted field with a date in the format DD-MM-YYYY HH:MM:SS.
  2. Observe the conversion error.

Proposed Solution:
Update the date format to YYYY-MM-DD HH:MM:SS. This can be accomplished using the following JavaScript code:

function convertDate(date) {
    const day = String(date.getDate()).padStart(2, '0');
    const month = String(date.getMonth() + 1).padStart(2, '0');
    const year = date.getFullYear();
    const hours = String(date.getHours()).padStart(2, '0');
    const minutes = String(date.getMinutes()).padStart(2, '0');
    const seconds = String(date.getSeconds()).padStart(2, '0');
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}

function getFormattedDate() {
    const date = new Date();
    return isNaN(date) ? "" : convertDate(date);
}

getFormattedDate();

Activity

  1. added
    bug
    on Apr 18, 2025
  2. sjoerdvandijkt4e commented on Nov 10, 2025

    @sjoerdvandijkt4e

    I just tested this within a new implementation (on a test portal and database). Implementing this from scratch and with a new database has no issues. I think we can update the fieldmapping with the convertDate as mentioned above.

    No issues found. I will change this in the new branch with name "feature-crosscheck"

  3. linked a pull request that will close this issueFeature retention period support #5on Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions