Date-Field with Article/Blog Posts

Hello everyone, I just copied the Kirby-Blog example Blueprints for a simple Blog, everything has worked so far except that the backend no longer displays the datefield. It says “days is not defined”

Have I done something wrong? I mean on the previous page I use the datefield to display when an article is written and it just works fine

        fields:
          date:
            type: date
            default: now

asxdasd

1 Like

Is that a newly created article or based on existing content? Have you updated Kirby without clearing the media folder?

In this case it was an old article. New articles as well show “days is not defined”.

No not really, I now just deleted both the content/media folders even after they were deleted I get the same error. Even now it shows the correct date on the previous page.

asdasure

I wonder why it says “days is not defined” when my field is called “date” everywhere

Could you please post your blueprint?

Sure.

title: Artikel

num: '{{ page.date.toDate("Ymd") }}'

status:

  draft:

    label: Entwurf

    text: Artikel als Entwurf

  unlisted:

    label: In Überprüfung

    text: Artikel die geprüft werden müssen.

  listed:

    label: Veröffentlicht

    text: Veröffentlichte Artikel

tabs:

  Artikel:

    columns:

      - width: 2/3

        fields:

          headline:

            type: text

          description:

            type: text

          cover:

            type: files

            max: 1

            uploads:

              template: artikel-image

          artikel:

            type: editor

            uploads:

              template: artikel-image

      - width: 1/3

        sections:

          meta:

            type: fields

            fields:

              date:

                type: date

                default: now

              author:

                type: users

              tags:

                type: tags

                options: query

                query: page.siblings.pluck("tags", ",", true)

          images:

            type: files

            template: artikel-image

  meta: tabs/seo/meta

What is your Kirby version? In 3.5, the default value should by today instead of now, although I don’t get the error in 3.5.1 even with your settings.

Oh I found the problem, I still had installed a plugin called “k3-date-format” which broke the datefield.

5 Likes

Had the same problem. Thanks for sharing your solution, casly.

2 Likes