kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Allow -??? summit numbers and XX/?? region codes as well
rodzic
62219867eb
commit
fa54e7f3f3
|
@ -152,11 +152,11 @@ export default {
|
||||||
handler () {
|
handler () {
|
||||||
if (this.summitCode) {
|
if (this.summitCode) {
|
||||||
// Shorthand input
|
// Shorthand input
|
||||||
let summitRegex = /^([A-Z0-9]{1,8})[/ ]([A-Z]{2})[- ]?([0-9]{3}|xxx)$/i
|
let summitRegex = /^([A-Z0-9]{1,8})[/ ]([A-Z]{2})[- ]?([0-9]{3}|xxx|\?\?\?)$/i
|
||||||
let matches = this.summitCode.match(summitRegex)
|
let matches = this.summitCode.match(summitRegex)
|
||||||
if (matches) {
|
if (matches) {
|
||||||
this.summitCode = (matches[1] + '/' + matches[2] + '-' + matches[3]).toUpperCase()
|
this.summitCode = (matches[1] + '/' + matches[2] + '-' + matches[3]).toUpperCase()
|
||||||
if (matches[3].toUpperCase() === 'XXX') {
|
if (matches[2].toUpperCase() === 'XX' || matches[2] === '??' || matches[3].toUpperCase() === 'XXX' || matches[3] === '???') {
|
||||||
this.summitInvalid = false
|
this.summitInvalid = false
|
||||||
this.summitCodeXxx = true
|
this.summitCodeXxx = true
|
||||||
this.summit = null
|
this.summit = null
|
||||||
|
|
Ładowanie…
Reference in New Issue