提交代码

master
胡锐 4 months ago
parent aaa7405c71
commit 2f357bccfb
  1. 2
      src/app/pages/trade/order-oil-list/order-oil-list.component.html
  2. 17
      src/app/utils/dateUtils.service.ts

@ -4,7 +4,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label>交易创建时间</nz-form-label> <nz-form-label>交易创建时间</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-range-picker formControlName="createTimeArray" nzShowTime [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker> <nz-range-picker formControlName="createTimeArray" nzShowTime [nzAllowClear]="false" [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker>
<nz-radio-group nzButtonStyle="solid" formControlName="createTimeSelect" (ngModelChange)="createTimeInit()"> <nz-radio-group nzButtonStyle="solid" formControlName="createTimeSelect" (ngModelChange)="createTimeInit()">
<label nz-radio-button *ngFor="let item of dateTypeSelect" nzValue="{{item.value}}">{{item.name}}</label> <label nz-radio-button *ngFor="let item of dateTypeSelect" nzValue="{{item.value}}">{{item.name}}</label>
</nz-radio-group> </nz-radio-group>

@ -119,4 +119,21 @@ export class DateUtils {
return returnObj; return returnObj;
} }
/**
*
* @param startTime
* @param endTime
*/
public static getDateSelectType(startTime: Date, endTime: Date): number {
const type = 0; // 未知
for (let type of DateSelectType) {
let date = this.getDate(new Date(), type.value);
if (startTime.toLocaleDateString() == new Date(date.timeS).toLocaleDateString()
&& endTime.toLocaleDateString() == new Date(date.timeE).toLocaleDateString()) {
return type.value;
}
}
return type;
}
} }

Loading…
Cancel
Save