Skip to content

Commit

Permalink
helper mixin titleCase update
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarry50 committed Oct 23, 2019
1 parent f5e9a4f commit a1e270c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 sbarry50
Copyright (c) 2019 Stephen Barry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions demo/data/demoHolidays.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"isOpen": true
}
],
"christmas eve": [
"christmas-eve": [
{
"open": "0700",
"close": "1700",
Expand All @@ -23,7 +23,7 @@
"isOpen": false
}
],
"memorial day": [
"memorial-day": [
{
"open": "0800",
"close": "1200",
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-business-hours.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-business-hours.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-business-hours.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-business-hours",
"description": "Vue component for selecting business hours.",
"version": "1.2.4",
"version": "1.2.5",
"author": "sbarry50",
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions src/mixins/helperMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import moment from 'moment';
export const helperMixin = {
methods: {
titleCase: function(str) {
var splitStr = str.toLowerCase().split(' ');
for (var i = 0; i < splitStr.length; i++) {
splitStr[i] =
splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
}
return splitStr.join(' ');
return str
.split('-')
.map(function capitalize(part) {
return part.charAt(0).toUpperCase() + part.slice(1);
})
.join(' ');
},
frontendTimeFormat: function(value) {
return moment(value, 'HHmm').format('hh:mm A');
Expand Down

0 comments on commit a1e270c

Please sign in to comment.