-
Notifications
You must be signed in to change notification settings - Fork 0
/
Month.ts
37 lines (36 loc) · 2.61 KB
/
Month.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export default class Month {
private month:string;
constructor(monthInMessage:string) {
this.month = monthInMessage
}
//поиск индекса (номера) месяца
SearchForTheNumberOfTheMonth():number{
let indexArray:number
let array: Array<string>
if(this.month == 'январь' || this.month == 'февраль' || this.month == 'март' || this.month == 'апрель'
|| this.month == 'май' || this.month == 'июнь' || this.month == 'июль' || this.month == 'август'
|| this.month == 'сентябрь' || this.month == 'октябрь' || this.month == 'ноябрь' || this.month == 'декабрь'){
array=['январь','февраль','март','апрель','май','июнь','июль','август','сентябрь','октябрь','ноябрь','декабрь']
}
else if(this.month == 'янв' || this.month == 'фев' || this.month == 'мар' || this.month == 'апр'
|| this.month == 'май' || this.month == 'июн' || this.month == 'июл' || this.month == 'авг'
|| this.month == 'сен' || this.month == 'окт' || this.month == 'ноя' || this.month == 'дек'){
array=['янв','фев','мар','апр','май','июн','июл','авг','сен','окт','ноя','дек']
}
else if(this.month == 'янв' || this.month == 'февр' || this.month == 'март' || this.month == 'апр'
|| this.month == 'май' || this.month == 'июнь' || this.month == 'июль' || this.month == 'авг'
|| this.month == 'сент' || this.month == 'октб' || this.month == 'нояб' || this.month == 'дек'){
array=['янв','февр','март','апр','май','июнь','июль','авг','сент','октб','нояб','дек']
}
else if(this.month == 'января' || this.month == 'февраля' || this.month == 'марта' || this.month == 'апреля'
|| this.month == 'мая' || this.month == 'июня' || this.month == 'июля' || this.month == 'августа'
|| this.month == 'сентября' || this.month == 'октября' || this.month == 'ноября' || this.month == 'декабря'){
array=['января','февраля','марта','апреля','мая','июня','июля','августа','сентября','октября','ноября','декабря']
}
else {
array = []
}
indexArray = array.indexOf(this.month)
return indexArray
}
}