Skip to content

Instantly share code, notes, and snippets.

@eclectic-coding
Created March 26, 2020 16:46
Show Gist options
  • Select an option

  • Save eclectic-coding/2531d192b7d08857204af848ff73d1c2 to your computer and use it in GitHub Desktop.

Select an option

Save eclectic-coding/2531d192b7d08857204af848ff73d1c2 to your computer and use it in GitHub Desktop.
Truncate text filter
filters: {
truncate: function (text, length, suffix) {
if (text.length > length) {
return text.substring(0, length) + suffix;
} else {
return text;
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment