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

Slice filter no longer works (with integers?) #117

Closed
paulrobertlloyd opened this issue Mar 31, 2019 · 1 comment
Closed

Slice filter no longer works (with integers?) #117

paulrobertlloyd opened this issue Mar 31, 2019 · 1 comment
Labels

Comments

@paulrobertlloyd
Copy link
Contributor

I was previously able to use the following to generate a series of two-digit month values. This worked by taking a number between 1 and 12, and essentially ‘zeropadding’ numbers between 1 and 9 using the slice filter:

{%- for i in (1..12) -%}
  {%- capture month %}{{ i | prepend: '00' | slice: -2, 2 }}{% endcapture -%}
  {{ month }},
{%- endfor -%}
// => 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12,

However, the slice filter no longer works for this use case, with no transformed number output. I tried converting i to a string by using append: '', but that didn’t work. In the end, I created a separate zero pad filter, but this seems unnecessary. I think the change is a result of moving to strictly typed code, but can’t be sure.

harttle added a commit that referenced this issue Apr 1, 2019
@harttle harttle added the bug label Apr 1, 2019
harttle pushed a commit that referenced this issue Apr 1, 2019
## [8.0.3](v8.0.2...v8.0.3) (2019-04-01)

### Bug Fixes

* slice filter on negative `begin`, [#117](#117) ([eadb6f3](eadb6f3))
@harttle
Copy link
Owner

harttle commented Apr 4, 2019

Try 8.0.3, reopen this issue if it does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants