cgserver 9.1.7 → 9.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -499,17 +499,17 @@ class core {
|
|
|
499
499
|
let time = new Date(now.getFullYear(), now.getMonth());
|
|
500
500
|
return time.getTime();
|
|
501
501
|
}
|
|
502
|
-
static
|
|
502
|
+
static getNextWeekStartTime() {
|
|
503
503
|
let one_day = 24 * 60 * 60 * 1000;
|
|
504
504
|
let time = this.getTodayStartTime();
|
|
505
505
|
let day = new Date().getDay();
|
|
506
|
-
return time - (day
|
|
506
|
+
return time + (7 - (day - 1)) * one_day;
|
|
507
507
|
}
|
|
508
508
|
static getCurWeekStartTime() {
|
|
509
509
|
let one_day = 24 * 60 * 60 * 1000;
|
|
510
510
|
let time = this.getTodayStartTime();
|
|
511
511
|
let day = new Date().getDay();
|
|
512
|
-
return time - day * one_day;
|
|
512
|
+
return time - (day - 1) * one_day;
|
|
513
513
|
}
|
|
514
514
|
static isSameMonth(src_time, target_time) {
|
|
515
515
|
let src_date = new Date(src_time);
|
|
@@ -16,6 +16,10 @@ class MongoCacheService extends MongoBaseService_1.MongoBaseService {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super("cache", MongoCacheModel);
|
|
18
18
|
cgserver_1.GCgServer.addListener("start", () => {
|
|
19
|
+
if (!this.mongoDb) {
|
|
20
|
+
//客户端未开启mongo
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
19
23
|
this.createIndex({ key: 1 });
|
|
20
24
|
this.createIndex({ "expireAt": 1 }, { expireAfterSeconds: 0 });
|
|
21
25
|
});
|
|
@@ -84,7 +84,7 @@ export declare class core {
|
|
|
84
84
|
static getStartTime(time?: number): number;
|
|
85
85
|
static getLastMonthStartTime(): number;
|
|
86
86
|
static getCurMonthStartTime(): number;
|
|
87
|
-
static
|
|
87
|
+
static getNextWeekStartTime(): number;
|
|
88
88
|
static getCurWeekStartTime(): number;
|
|
89
89
|
static isSameMonth(src_time: number, target_time: number): boolean;
|
|
90
90
|
static isSameDay(src_time: number, target_time: number): boolean;
|