Revize 696f3358
Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)
webapp/src/app/services/api/user.service.ts | ||
---|---|---|
9 | 9 |
import {UserProfile} from '../../models/user.model'; |
10 | 10 |
import {UserRequest} from '../../models/requests.model'; |
11 | 11 |
import {MatSnackBar} from '@angular/material'; |
12 |
import {DateFormatterService} from '../util/date-formatter.service'; |
|
12 | 13 |
|
13 | 14 |
@Injectable({ |
14 | 15 |
providedIn: 'root' |
... | ... | |
16 | 17 |
export class UserService extends BasicService { // dost podobny k usersService, mozna zmenit v rest api |
17 | 18 |
private _userUrl = this.baseUrl + '/api/user/'; |
18 | 19 |
|
19 |
constructor(protected http: HttpClient, protected snackBar: MatSnackBar) { |
|
20 |
constructor(protected http: HttpClient, protected snackBar: MatSnackBar, private dateFormater: DateFormatterService) {
|
|
20 | 21 |
super(http, snackBar); |
21 | 22 |
} |
22 | 23 |
|
... | ... | |
188 | 189 |
* @param status filter by status |
189 | 190 |
*/ |
190 | 191 |
private makeGetCalendarApiCall(id: string, from: Date, to: Date, language: Languages, status: RequestStatus) { |
191 |
const fromString: string = from.getFullYear() + '/' + from.getMonth() + '/' + from.getDate();
|
|
192 |
const fromString: string = this.dateFormater.formatDate(from);
|
|
192 | 193 |
let toString: string; |
193 | 194 |
if (to != null) { |
194 |
toString = to.getFullYear() + '/' + to.getMonth() + '/' + to.getDate();
|
|
195 |
toString = this.dateFormater.formatDate(to);
|
|
195 | 196 |
} |
196 | 197 |
|
197 | 198 |
const httpParams: HttpParams = this.createParams({lang: language, from: fromString, to: toString, status}); |
Také k dispozici: Unified diff
Re #7494 Components connected to API - except profile settings and add vacation components