AW-1844 Fix fmHasPackage
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
This commit is contained in:
parent
1ade8025ab
commit
0f1ce45b2f
@ -16,7 +16,7 @@ export class HasPackageDirective implements OnInit,OnDestroy{
|
||||
private packSub:Subscription;
|
||||
ngOnInit() {
|
||||
this.packages$.subscribe((packages) => {
|
||||
const today = new Date(Date.now()).setHours(0,0,0,0);
|
||||
const today = new Date(Date.prototype.getUTCDate()).setHours(0,0,0,0);
|
||||
if (packages[this.package] &&
|
||||
packages[this.package].enabled &&
|
||||
(packages[this.package].DataDate && new Date(packages[this.package].DataDate).setHours(0, 0, 0, 0) <= today) &&
|
||||
|
@ -2,6 +2,8 @@ export interface IPackage {
|
||||
id:string
|
||||
name:string;
|
||||
enabled?:boolean;
|
||||
dataDate?:Date;
|
||||
dataEndDate?:Date;
|
||||
}
|
||||
|
||||
export interface IPackages {
|
||||
|
@ -116,7 +116,9 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
||||
let a = action as appCommonActions.InitUserPackagesSuccess;
|
||||
let packages = {}
|
||||
a.items.forEach((item) => {
|
||||
packages[item.data.id]=item.data;
|
||||
item.data.dataDate = item.dataDate;
|
||||
item.data.dataEndDate = item.dataEndDate;
|
||||
packages[item.data.id]=item.data;
|
||||
});
|
||||
|
||||
return tassign(state,{userPackages:packages});
|
||||
|
Loading…
Reference in New Issue
Block a user