mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-10 01:01:45 +00:00
Better date syntax
This commit is contained in:
+3
-3
@@ -56,7 +56,7 @@ class UserActivity {
|
|||||||
* (ie. within a few seconds)
|
* (ie. within a few seconds)
|
||||||
*/
|
*/
|
||||||
userCurrentlyActive() {
|
userCurrentlyActive() {
|
||||||
return this.lastActivityAtTs > (new Date).getTime() - CURRENTLY_ACTIVE_THRESHOLD_MS;
|
return this.lastActivityAtTs > new Date().getTime() - CURRENTLY_ACTIVE_THRESHOLD_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUserActivity(event) {
|
_onUserActivity(event) {
|
||||||
@@ -71,7 +71,7 @@ class UserActivity {
|
|||||||
this.lastScreenY = event.screenY;
|
this.lastScreenY = event.screenY;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastActivityAtTs = (new Date).getTime();
|
this.lastActivityAtTs = new Date().getTime();
|
||||||
if (this.lastDispatchAtTs < this.lastActivityAtTs - MIN_DISPATCH_INTERVAL_MS) {
|
if (this.lastDispatchAtTs < this.lastActivityAtTs - MIN_DISPATCH_INTERVAL_MS) {
|
||||||
this.lastDispatchAtTs = this.lastActivityAtTs;
|
this.lastDispatchAtTs = this.lastActivityAtTs;
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
@@ -86,7 +86,7 @@ class UserActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onActivityEndTimer() {
|
_onActivityEndTimer() {
|
||||||
var now = (new Date).getTime();
|
var now = new Date().getTime();
|
||||||
var targetTime = this.lastActivityAtTs + MIN_DISPATCH_INTERVAL_MS;
|
var targetTime = this.lastActivityAtTs + MIN_DISPATCH_INTERVAL_MS;
|
||||||
if (now >= targetTime) {
|
if (now >= targetTime) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
|
|||||||
Reference in New Issue
Block a user