hotFix: ticketAdvanced
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-07-26 13:47:15 +02:00
parent 0ab40dbfb2
commit 2505adf87f
2 changed files with 3 additions and 27 deletions

View File

@ -62,8 +62,11 @@ export default class Controller extends Section {
setDefaultFilter() { setDefaultFilter() {
let today = Date.vnNew(); let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const tomorrow = new Date(today); const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(23, 59, 59, 999);
this.$http.get(`UserConfigs/getUserConfig`) this.$http.get(`UserConfigs/getUserConfig`)
.then(res => { .then(res => {
this.filterParams = { this.filterParams = {
@ -86,15 +89,6 @@ export default class Controller extends Section {
return checkedLines; return checkedLines;
} }
dateRange(value) {
const minHour = new Date(value);
minHour.setHours(0, 0, 0, 0);
const maxHour = new Date(value);
maxHour.setHours(23, 59, 59, 59);
return [minHour, maxHour];
}
totalPriceColor(totalWithVat) { totalPriceColor(totalWithVat) {
return this.isLessThan50(totalWithVat) ? 'warning' : ''; return this.isLessThan50(totalWithVat) ? 'warning' : '';
} }

View File

@ -36,24 +36,6 @@ describe('Component vnTicketAdvance', () => {
}); });
}); });
describe('dateRange()', () => {
it('should return two dates with the hours at the start and end of the given date', () => {
const now = Date.vnNew();
const today = now.getDate();
const dateRange = controller.dateRange(now);
const start = dateRange[0].toString();
const end = dateRange[1].toString();
expect(start).toContain(today);
expect(start).toContain('00:00:00');
expect(end).toContain(today);
expect(end).toContain('23:59:59');
});
});
describe('moveTicketsAdvance()', () => { describe('moveTicketsAdvance()', () => {
it('should make an HTTP Post query', () => { it('should make an HTTP Post query', () => {
jest.spyOn(controller.$.model, 'refresh'); jest.spyOn(controller.$.model, 'refresh');