GithubHelp home page GithubHelp logo

Comments (7)

mattwolff avatar mattwolff commented on July 25, 2024 1

I'm having the same issue. I'm unable to specify how dates are formatted. As a temporary workaround (NOT a fix), I've changed my column to be a text field type: text.

columns:
  title:
      label: Title
      text: '{{ page.title }}'
      type: text
  date:
      label: Date
      type: text
      text: '{{ page.date.toDate('M. d, Y') }}'
      # for only years like 2014 use 'Y'
      # text: '{{ page.date.toDate('Y') }}'

Could this have something to with how tbl-for-kirby handles dates?

from kirby-pagetable.

christianschley avatar christianschley commented on July 25, 2024

Have you tried this yet?

text: '{{ page.earliestdate.toDate }}'

or:
text: '{{ page.earliestdate.toDate('YYYY') }}'

from kirby-pagetable.

trych avatar trych commented on July 25, 2024

I tried it now, both these options result in the output Invalid date.

from kirby-pagetable.

trych avatar trych commented on July 25, 2024

Nice! This works for me.
But, as you said, since this is not an actual fix for the feature, I will leave the issue open for now.

from kirby-pagetable.

romanustin avatar romanustin commented on July 25, 2024

Also having this problem, thanks for hint. By the way, it was working as "type: date" with earlier version of Kirby, about year ago. Would work like this:

date:
    label: Date
    type: date
    text: '{{ page.modified("Y-m-d-H-i") }}'
    dateInputFormat: 'YYYY-MM-DD-HH-mm'
    dateOutputFormat: 'DD-MM, HH:mm'

from kirby-pagetable.

therephil avatar therephil commented on July 25, 2024

tbl-for-kirby specifies how the date is formatted without an option to style it: https://github.com/distantnative/tbl-for-kirby/blob/master/src/component/Table.vue#L544

so the dateInputFormat and dateOutputFormat keys are obsolete since c731edd.

from kirby-pagetable.

sylvainjule avatar sylvainjule commented on July 25, 2024

I will revert to using vue-good-table for now, so this formatting rule will apply. Keeping tbl is hard to maintain for me.

I will probably update to something like a tbl-for-kirby custom-made for this section (but keeping the compatibility for this date format thing), like Retour does now (which shared the use of tbl previously) whenever I find time to work on the enhancement requests.

from kirby-pagetable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.