Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PagesSection] Cannot use comma in info query #1402

Closed
neildaniels opened this issue Jan 25, 2019 · 8 comments
Closed

[PagesSection] Cannot use comma in info query #1402

neildaniels opened this issue Jan 25, 2019 · 8 comments
Assignees
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@neildaniels
Copy link
Contributor

Describe the bug
Within a type: pages section, if I do something like:

info: "{{ page.created.toDate('M j, Y') }}"

then the comma and everything after it will be missing.

For reference, this is what the created field is created as:

  created:
    label: Created On
    type:  date
    time:
      interval: 5
    default: now

To Reproduce
Steps to reproduce the behavior:

  1. Have a pages section in the panel, with the mentioned info field
  2. Those pages should have a created (or similarly named filed)

Expected behavior
I would expect to see dates in the format of "Jan 24, 2018". Instead, it just shows "Jan 24".

If you change the format to something like 'M, j Y', then it will just show "Jan".

Screenshots
screen shot 2019-01-24 at 4 46 40 pm

Kirby Version
3.0.0

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Safari
  • Version: 12.0.3

Additional context
Other characters like ; instead of , work fine, but that is a weird way to write dates.

@texnixe
Copy link
Member

texnixe commented Jan 25, 2019

Things that work:

info: >
  {{ page.date.toDate("M d, Y") }}

or:

info: |
  {{ page.date.toDate("M d, Y") }}

or:

info: "{{ page.date.toDate('M d, Y') }}"

@neildaniels
Copy link
Contributor Author

info: '{{ page.created.toDate("M j, Y") }}'

This works as well. Seems like the comma requires the date string being surrounded by double quotes ", and the entire thing must be surrounded by single quotes '.

@bastianallgeier
Copy link
Member

Hm, could be another weirdness of the yaml parser. I have to check that out.

@bastianallgeier bastianallgeier added the type: bug 🐛 Is a bug; fixes a bug label Feb 2, 2019
@bastianallgeier bastianallgeier added this to the 3.0.2 milestone Feb 2, 2019
@texnixe
Copy link
Member

texnixe commented Feb 3, 2019

Probably related:

pluck('tags', ',') // empty delimiter error
pluck('tags', ",") // works

@bastianallgeier bastianallgeier removed this from the 3.0.2 milestone Feb 8, 2019
@distantnative distantnative changed the title Cannot Use Comma in Panel Pages Section's Info Field [PagesSection] Cannot use comma in info query Mar 6, 2019
@bastianallgeier bastianallgeier added this to the 3.1.1 milestone Mar 12, 2019
@distantnative distantnative modified the milestones: 3.1.2, 3.1.3 Mar 30, 2019
@bastianallgeier bastianallgeier removed this from the 3.1.3 milestone Apr 12, 2019
@distantnative distantnative added this to the 3.2.2 milestone Apr 16, 2019
@distantnative
Copy link
Member

@texnixe @neildaniels Wondering if this might have been solved as well with the new Query refactoring for 3.2.0. Will try to test it in the next days.

@distantnative distantnative self-assigned this Apr 18, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.2.2, 3.2.3 Jul 10, 2019
@distantnative
Copy link
Member

@neildaniels any chance you could test this?

@texnixe
Copy link
Member

texnixe commented Jul 18, 2019

@distantnative The original example works in 3.2.2 with single quotes now. I think we can close this.

@distantnative
Copy link
Member

Thanks, @texnixe.
@neildaniels Please feel free to reopen if you still encounter it somehow, somewhere.

@distantnative distantnative removed this from the 3.2.3 milestone Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

4 participants