1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import { actions, reducer, state } from './state'
- import components from './components'
- import { normalize } from '../helpers.js'
- const filters = {
- all: players => players,
- }
- const selectors = {}
- class Player {
-
- constructor (data) {
- this.Konkurrenz = normalize(data[0])
- this.Lizenz = normalize(data[2])
- this.Name = normalize(data[5])
- this.Vorname = normalize(data[6])
- this.Geburtsdatum = data[7]
- this.Klassierung = normalize(data[17])
- this.LizenzDP = normalize(data[23])
- this.NameDP = normalize(data[24])
- this.VornameDP = normalize(data[25])
- this.GeburtsdatumDP = data[26]
- this.KlassierungDP = normalize(data[27])
- this.Bestaetigt = data[29]
- this.Bezahlt = data[31]
- this.BezahltAm = null
- this.Matches = []
- this.isDoubles = this.Konkurrenz.match(/DM.*|[MW]D.*/)
- this.isJunior = (this.Geburtsdatum) ? this.Geburtsdatum.getTime() >= (new Date((new Date()).getFullYear() - 18, 11, 31, 23, 59, 59, 999)).getTime() : false
- this.isJuniorDP = (this.isDoubles & !!this.GeburtsdatumDP) ? this.GeburtsdatumDP.getTime() >= (new Date((new Date()).getFullYear() - 18, 11, 31, 23, 59, 59, 999)).getTime() : false
- this.name = this.isDoubles ? `${this.Name} ${this.Vorname} / ${this.NameDP} ${this.VornameDP}` : `${this.Name} ${this.Vorname}`
- }
- }
- export default { Player, actions, components, filters, selectors, reducer, state }
|