Skip to content
Snippets Groups Projects
Commit d418d499 authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

Adds humanize function equivalent to ruby

parent 9d8de1c9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -112,6 +112,9 @@
gl.text.removeListeners = function(form) {
return $('.js-md', form).off();
};
gl.text.humanize = function(string) {
return string.charAt(0).toUpperCase() + string.replace(/_/g, ' ').slice(1);
}
return gl.text.truncate = function(string, maxLength) {
return string.substr(0, (maxLength - 3)) + '...';
};
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment