The liquid template language

At many places where you use text input or parameters you can actually use liquid templates.

Liquid is a templating language originally created by Shopify, but used at many places. Taskbone uses LiquidJS under the hood. Their documentation is probably a good place to start learning about the language:

On top of the standard LiquidJS functionality, Taksbone provides some additional filters, described here:

Date operations

All date operations support inputs in the following formats:

  • ISO 8601 (e.g. 2024-10-07, 2024-10-07T15:30, 2024-10-07T15:30+0400)
  • RFC2822 (e.g. 07 Oct 2024 15:30:00 -0400)
  • yyyy-MM-dd HH:mm (e.g. 2024-10-07 15:30)

Add or subtract time

You can add or subtract time with the following filters:

Add time

  • plusMilliseconds
  • plusSeconds
  • plusMinutes
  • plusHours
  • plusDays
  • plusWeeks
  • plusMonths
  • plusQuarters
  • plusYears

Subtract time

  • minusMilliseconds
  • minusSeconds
  • minusMinutes
  • minusHours
  • minusDays
  • minusWeeks
  • minusMonths
  • minusQuarters
  • minusYears

Example

{% assign dueDate = "2024-08-01T20:00" %}
- Client call @due({{ dueDate }})
    - Pull report @due({{ dueDate | minusDays: 18}})
    - Pre-Call E-Mail @due({{ dueDate | minusDays: 14}})
- Review Call @due({{ dueDate | plusWeeks: 1}})
- Do it again @due({{ dueDate | plusQuarters: 1}})

gets converted to:

- Client call @due(2024-08-01T20:00)
    - Pull report @due(2024-07-14)
    - Pre-Call E-Mail @due(2024-07-18)
- Review Call @due(2024-08-08)
- Do it again @due(2024-11-01)

formatDateTime

The formatDate filter delivers standard, human readable date formats. You can choose between three levels of verbosity.

  • FULL (very long an verbose)
  • MED
  • SHORT

and provide a language/locale (e.g. en-us, en, de-de, de-at)

Example:

{% assign dueDate = "2023-01-08T20:00" %}

{{dueDate | formatDateTime: 'FULL', 'en'}}
{{dueDate | formatDateTime: 'SHORT', 'en'}}
{{dueDate | formatDateTime: 'SHORT', 'en-ca'}}

{{dueDate | formatDateTime: 'MED', 'de-at'}}
{{dueDate | formatDateTime: 'MED', 'de'}}

gets converted to:

January 8, 2023 at 8:00 PM UTC
1/8/2023, 8:00 PM
2023-01-08, 8:00 p.m.

8. Jän. 2023, 20:00
8. Jan. 2023, 20:00

String manipulation

replaceRegex

Regex find/replace.

Example

{% assign text = "hellO How aRe You?" %}
{{ text | replaceRegex: "[a-z]", "_" }}

gets converted to:

____O H__ _R_ Y__?

replaceAtPosition

Replaces a substring of the input with a different string.

Parameters:

  • string to insert
  • position to start replace
  • length of substring to replace

Example:

{% assign text = "Hello how are you?" %}
{{ text | replaceAtPosition: "what", 6, 3}}

gets converted to:

Hello what are you?