import ngModule from '../module'; import Section from 'salix/components/section'; export default class Controller extends Section { constructor($element, $) { super($element, $); } exprBuilder(param, value) { switch (param) { case 'issued': return {'ii.issued': { between: this.dateRange(value)} }; case 'serial': return {[`ii.${param}`]: value}; } } 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]; } } Controller.$inject = ['$element', '$scope']; ngModule.vnComponent('vnInvoiceInSerial', { template: require('./index.html'), controller: Controller });