diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts index af793a6b9..900f532ad 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts @@ -2,7 +2,6 @@ import { formatDate } from '@angular/common'; import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core'; import { select, Store } from '@ngrx/store'; import { DataTableDirective } from 'angular-datatables'; -import * as moment from 'moment'; import { Observable, Subject, Subscription } from 'rxjs'; import { Entry } from 'src/app/modules/shared/models'; import { DataSource } from 'src/app/modules/shared/models/data-source.model'; @@ -22,38 +21,31 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn buttons: [ { extend: 'colvis', - columns: ':not(.hidden-col)', + columns: ':not(.hidden-col),visible' + }, + { + extend: 'print', + exportOptions: { + columns: ':visible' + } }, - 'print', { extend: 'excel', exportOptions: { - format: { - body: (data, row, column, node) => { - return column === 3 ? - moment.duration(data).asHours().toFixed(4).slice(0, -1) : - data; - }, - }, + columns: ':visible' }, text: 'Excel', - filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`, + filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}` }, { extend: 'csv', exportOptions: { - format: { - body: (data, row, column, node) => { - return column === 3 ? - moment.duration(data).asHours().toFixed(4).slice(0, -1) : - data; - }, - }, + columns: ':visible' }, text: 'CSV', - filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`, + filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}` }, - ], + ] }; dtTrigger: Subject = new Subject(); @ViewChild(DataTableDirective, { static: false }) diff --git a/src/styles.scss b/src/styles.scss index 514ed1fbb..6fbc189b3 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -61,3 +61,32 @@ Overwritten calendar style .cal-header .cal-cell { border: 0.1px solid lighten($primary-text, 30%); } + +@media (max-width: 640px) { + div.dt-buttons { + text-align: start !important; + } + .dataTables_wrapper .dataTables_filter { + text-align: start !important; + } + div.dt-button-collection { + position: fixed !important; + top: 250px !important; + margin-left: 50px !important; + overflow-y: scroll !important; + max-height: 300px !important; + button.active:not(.disabled) { + background: $primary !important; + box-shadow: none !important; + } + } +} + +@media (min-width: 576px) { + div.dt-button-collection { + button.active:not(.disabled) { + background: $primary !important; + box-shadow: none !important; + } + } +} \ No newline at end of file