Skip to content

Instantly share code, notes, and snippets.

View martin-sweeny's full-sized avatar
💢

◢◤◢◤ martin-sweeny

💢
View GitHub Profile
@martin-sweeny
martin-sweeny / gist:c66cf1acd92e91949b8d3ad65c889ec9
Created February 9, 2017 05:02 — forked from belsrc/gist:672b75d1f89a9a5c192c
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];