diff --git a/src/common/common.js b/src/common/common.js index 2d15edf..89a0f7a 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -188,6 +188,17 @@ const common = { showImage(event) { return (event.target.style.visibility = 'visible'); }, + + addHyphenToPhoneNumber(phoneNum) { + const phoneNumber = phoneNum; + const length = phoneNumber.length; + + if (length >= 9) { + return phoneNumber.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`); + } else { + return phoneNum; + } + }, }; export default { diff --git a/src/components/main/MainEventCalendar.vue b/src/components/main/MainEventCalendar.vue index ba7a195..bc06eb1 100644 --- a/src/components/main/MainEventCalendar.vue +++ b/src/components/main/MainEventCalendar.vue @@ -1,47 +1,45 @@