Skip to content

Date time display in version history #1

Description

@antartoo

I just started testing your wonderful wiki blocks plugin, it's great for the education purposes of my wordpress site.
However, I have some problem displaying the correct modified date times when viewing the history on my wiki block.

The time zone of my wordpress site is set to Asia/Hong_Kong, but the date time displayed in the version history are being shown as UTC time.
I looked into the ajax response json when loading version history, the date value of "created_at" has no time zone info at the end of the string.

I assume the frontend formatDate() function date.toLocaleDateString() / date.toLocaleTimeString() would not work without the time zone info?

Could you please help give me some advice on how to properly setup or resolve this? Thanks a lot.

{
    "success": true,
    "data": {
        "versions": [
            {
                "id": "19",
                "version_number": "3",
                "content": "...",
                "change_summary": "Edited in backend editor",
                "is_current": true,
                "created_at": "2026-01-12 22:53:07",
                "user": {
                }
            },
...

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions