Skip to content

datetime widget shows user's timezone but saves in UTC #7319

Open
@Strubbl

Description

@Strubbl

Describe the bug
If i see the datetime widget, it correctly shows my local time. When i set the date to now and save, the date&time is saved for UTC, e.g. 2024-10-31T20:57:00.000Z but should save it as 2024-10-31T20:57:00+02:00.

To Reproduce

  1. create content
  2. use the a datetime widget
  3. hit the "now" button
  4. save

Expected behavior
2024-10-31T20:57:00+02:00 is saved

Applicable Versions:

  • Decap CMS version: 3.3.3
  • Git provider: gitlab
  • OS: Archlinux
  • Browser version Firefox 132

CMS configuration

backend:
  name: gitlab
  repo: asdf/gfhrehrther
  branch: master
  auth_type: pkce
  app_id: asdf
site_url: https://sadfgsdfgsdfgsdfg.as
media_folder: "static/images"
public_folder: "/images"
collections:
  - name: "blog"
    label: "Blog Posts"
    label_singular: "Blog Post"
    folder: "content/post"
    create: true
    slug: "{{slug}}"
    editor:
      preview: false
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Draft", name: "draft", widget: "boolean" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Category", name: "category", widget: "select", multiple: true, min: 1, options: [] }
      - { label: "Tags", name: "tag", widget: "list", min: 1 }
      - { label: "Body", name: "body", widget: "markdown" }
    view_filters:
      - label: Drafts
        field: draft
        pattern: true
    view_groups:
      - label: Category
        field: category

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions