Skip to content

Commit

Permalink
βœ” πŸ˜’ Fix DateTime ⏱
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed Sep 23, 2023
1 parent bb99eb5 commit 9db51f8
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 32 deletions.
1 change: 0 additions & 1 deletion dist/fansubid/browser/794.256bf119b7cfd83f.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/fansubid/browser/794.ba1bbafc3a11d81d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/fansubid/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<noscript>πŸŽ‰ Harap Menyalakan JavaScript Untuk Dapat Mengakses Website Ini ✨</noscript>
</div>
<app-root></app-root>
<script src="runtime.bbf7c4257b2d6a5b.js" type="module"></script><script src="polyfills.bbae203fdd01cf64.js" type="module"></script><script src="scripts.25bb5de51afc8a05.js" defer></script><script src="main.8f0707d5fa501202.js" type="module"></script>
<script src="runtime.480348d20046a288.js" type="module"></script><script src="polyfills.bbae203fdd01cf64.js" type="module"></script><script src="scripts.25bb5de51afc8a05.js" defer></script><script src="main.1d8777131d96f25d.js" type="module"></script>


</body></html>
1 change: 1 addition & 0 deletions dist/fansubid/browser/main.1d8777131d96f25d.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/fansubid/browser/main.8f0707d5fa501202.js

This file was deleted.

16 changes: 8 additions & 8 deletions dist/fansubid/browser/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1695469662802,
"timestamp": 1695476804346,
"index": "/index.html",
"assetGroups": [
{
Expand Down Expand Up @@ -31,7 +31,7 @@
"/734.c6d19ab68fe20363.js",
"/750.ebd8141ed453be68.js",
"/772.ad33717dcabe158b.js",
"/794.256bf119b7cfd83f.js",
"/794.ba1bbafc3a11d81d.js",
"/839.32e53804ab79aa26.js",
"/847.bcd84d31b0cbac5a.js",
"/915.963bdeecbe73cd07.js",
Expand All @@ -40,10 +40,10 @@
"/common.9328880044a7fd63.js",
"/favicon.ico",
"/index.html",
"/main.8f0707d5fa501202.js",
"/main.1d8777131d96f25d.js",
"/manifest.webmanifest",
"/polyfills.bbae203fdd01cf64.js",
"/runtime.bbf7c4257b2d6a5b.js",
"/runtime.480348d20046a288.js",
"/scripts.25bb5de51afc8a05.js",
"/styles.cc219f76eabe7138.css"
],
Expand Down Expand Up @@ -104,19 +104,19 @@
"/734.c6d19ab68fe20363.js": "940f58ade3c2ef29356d65fed32bebae667b1471",
"/750.ebd8141ed453be68.js": "4d545961aeeba3910e1052c27f0b734c61a4bcba",
"/772.ad33717dcabe158b.js": "f49a7512f871ddcb3f07d2e1d54d635baa8608f9",
"/794.256bf119b7cfd83f.js": "61dc735225b290a29f41edf67df627c6063a8b39",
"/794.ba1bbafc3a11d81d.js": "92112dce145df531385245187844cfbf43b19a32",
"/839.32e53804ab79aa26.js": "41cca1ad00ed3c5d08b1eea69a521939ccca1efe",
"/847.bcd84d31b0cbac5a.js": "14ecd3b22672411212f5b77b1b05f6dccad8ec4a",
"/915.963bdeecbe73cd07.js": "054a839f84adaa4ca6c97067da4ddfc136e78dec",
"/939.f39fd771f85dfa3b.js": "2463629eff2a83d62d16622370d85a9880f089cd",
"/960.1e1fe3434266e9a4.js": "c649bd883373fc66f7e2781d27054b5da57413a3",
"/common.9328880044a7fd63.js": "597ee1dc67b43fb372bc1221d81ee45b6b70e9c4",
"/favicon.ico": "071facb8fab2e4b3493dcfbb0b02d7bd21bca97e",
"/index.html": "e192fce9aaaa6af3313f640bb60619a6dc349de5",
"/main.8f0707d5fa501202.js": "4f80b1fdb80d3ad58e3d2afc8aecb89dbb43b374",
"/index.html": "8f3bddde791b509b5faa3233f5989a451ac15977",
"/main.1d8777131d96f25d.js": "3b995cc2c96fd84fe3173678f2ca9c86b72d3d9b",
"/manifest.webmanifest": "eafb5426cdc9fd714787e5453af315b9972875a3",
"/polyfills.bbae203fdd01cf64.js": "a59f17cf29cb649f708d7ec7aa6b7247712859e1",
"/runtime.bbf7c4257b2d6a5b.js": "e203bb58fdae189e82c46864bdb8d4f6431f086f",
"/runtime.480348d20046a288.js": "59134fcacf9b1705b26e15a539104a1b31e53a97",
"/scripts.25bb5de51afc8a05.js": "61d71afde3d3c58daff9d6801601386596732294",
"/styles.cc219f76eabe7138.css": "4c5a85052f050c876427947a8d75459753879403"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fansubid/server/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/api/controllers/fansub.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export class FansubController {
}, HttpStatus.FORBIDDEN);
}
}
fansub.slug = `${fansub.slug}~${new Date().getTime()}`;
fansub.slug = `${fansub.slug}~${Date.now()}`;
fansub.editable = false;
const updatedFansub = await this.fansubRepo.save(fansub);
const deletedFansub = await this.fansubRepo.remove(updatedFansub);
Expand Down
2 changes: 1 addition & 1 deletion src/api/controllers/image.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ImageController {
)
async imgBb(@Req() req: Request, @Res({ passthrough: true }) res: Response): Promise<any> {
try {
const dateTime = new Date().getTime().toString();
const dateTime = Date.now().toString();
const imgB64 = this.cs.convertToBase64(req.file.buffer);
const url = new URL(environment.externalApiImage);
const form = new FormData();
Expand Down
2 changes: 1 addition & 1 deletion src/api/controllers/notification.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class NotificationController {
) {
const user: UserModel = res.locals['user'];
let notifTemplate: NotificationModel = {
id: new Date().getTime(),
id: Date.now(),
type: req.body.type,
title: req.body.title,
content: req.body.content,
Expand Down
2 changes: 1 addition & 1 deletion src/api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function reqResEvent(req: Request, res: Response, next: NextFunction) {
});
res.on('close', () => {
const clientOriginIpCc = aks.getOriginIpCc(req, true);
const timeEnd = new Date().getTime() - timeStart.getTime();
const timeEnd = Date.now() - timeStart.getTime();
const reqResInfo = `${clientOriginIpCc.origin_ip} ~ ${timeStart.toString()} ~ ${req.method} ~ ${res.statusCode} ~ ${req.originalUrl} ~ ${timeEnd} ms`;
sis.emitToRoomOrId(CONSTANTS.socketRoomNameServerLogs, 'console-log', reqResInfo);
});
Expand Down
2 changes: 1 addition & 1 deletion src/api/middlewares/register.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class RegisterMiddleware implements NestMiddleware {
penggunaSave = await this.registrationRepo.save(penggunaSave);
res.locals['registration'] = penggunaSave;
this.sr.addTimeout(
`${CONSTANTS.timeoutCancelRegisterKey}-${new Date().getTime()}`,
`${CONSTANTS.timeoutCancelRegisterKey}-${Date.now()}`,
setTimeout(async () => {
try {
const registrationToBeDeleted = await this.registrationRepo.findOneOrFail({
Expand Down
2 changes: 1 addition & 1 deletion src/api/services/discord.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class DiscordService {
if (msg.content === '~about') {
await msg.reply({ content: `<@${msg.author.id}> https://github.com/${environment.author}/${environment.siteName}` });
} else if (msg.content === '~ping') {
const latency = new Date().getTime() - new Date(msg.createdTimestamp).getTime();
const latency = Date.now() - new Date(msg.createdTimestamp).getTime();
await msg.reply({ content: `<@${msg.author.id}> Pong ${latency} ms late!` });
} else if (msg.content.startsWith('~verify ')) {
await this.verifyAccount(msg);
Expand Down
4 changes: 2 additions & 2 deletions src/api/services/mkv-extract.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class MkvExtractService {
async mkvExtract(fileName: string, filePath: string): Promise<any[]> {
return new Promise((resolve, reject) => {

const startTime = new Date().getTime();
const startTime = Date.now();
this.gs.log(`[MKVEXTRACT_START] πŸ“‚ ${fileName} -- ${startTime} 🧬`);

const fileStream = createReadStream(filePath);
Expand Down Expand Up @@ -184,7 +184,7 @@ export class MkvExtractService {
size: subtitleFileSize[idx]
});
};
const endTime = new Date().getTime();
const endTime = Date.now();
this.gs.log(`[MKVEXTRACT_END] 🎬 ${fileName} -- ${endTime} -- ${(endTime - startTime) / 1000} seconds 🧬`);
if (files.length === 0) {
reject(Error('No data found'));
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/user/user-detail/user-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class UserDetailComponent implements OnInit, OnDestroy {

get accountAge(): number {
return Math.abs(new Date(
new Date().getTime() - new Date(this.userData.created_at).getTime()
Date.now() - new Date(this.userData.created_at).getTime()
).getUTCFullYear() - 1970);
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/user/user-list/user-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class UserListComponent implements OnInit, OnDestroy {
input: {
name: {
inputLabel: 'Nama / Deskripsi',
inputPlaceholder: `${this.as.currentUserSubject?.value?.username}_${new Date().getTime()}`,
inputPlaceholder: `${this.as.currentUserSubject?.value?.username}_${Date.now()}`,
inputValue: null,
inputRequired: true
},
Expand Down
8 changes: 4 additions & 4 deletions src/app/_shared/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ export class AuthService {
this.token = respVerify.token;
if (this.token) {
const expires = new Date(this.cs.jwtView(this.token).exp * 1000);
const minBefore = 5 * 60 * 1000;
const notifTime = expires.getTime() - minBefore;
const expireTime = expires.getTime();
const notifTime = expireTime - 5 * 60 * 1000;
this.cleanUpTimeoutInterval();
this.timeoutNotif = setTimeout(() => {
this.timeoutToast = this.toast.warning(
`Sesi Akun Akan Habis!`,
`Silahkan Logout & Login Ulang ...`,
{
closeButton: false,
timeOut: minBefore,
timeOut: expireTime - Date.now(),
disableTimeOut: 'extendedTimeOut',
tapToDismiss: false,
progressAnimation: 'decreasing'
Expand All @@ -68,7 +68,7 @@ export class AuthService {
);
}, notifTime - Date.now());
this.intervalLogout = setInterval(() => {
const distance = expires.getTime() - new Date().getTime();
const distance = expireTime - Date.now();
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
Expand Down
8 changes: 4 additions & 4 deletions src/app/_shared/services/toast.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ToastService {

success(message?: string, title?: string, override?: Partial<IndividualConfig>, force = false): ActiveToast<any> {
if (force) {
this.notif.addNotif(null, new Date().getTime(), 'success', title, message);
this.notif.addNotif(null, Date.now(), 'success', title, message);
}
if (this.gs.isDesktop || force) {
return this.toast.success(message, title, override);
Expand All @@ -36,7 +36,7 @@ export class ToastService {

warning(message?: string, title?: string, override?: Partial<IndividualConfig>, force = false): ActiveToast<any> {
if (force) {
this.notif.addNotif(null, new Date().getTime(), 'warning', title, message);
this.notif.addNotif(null, Date.now(), 'warning', title, message);
}
if (this.gs.isDesktop || force) {
return this.toast.warning(message, title, override);
Expand All @@ -46,7 +46,7 @@ export class ToastService {

info(message?: string, title?: string, override?: Partial<IndividualConfig>, force = false): ActiveToast<any> {
if (force) {
this.notif.addNotif(null, new Date().getTime(), 'info', title, message);
this.notif.addNotif(null, Date.now(), 'info', title, message);
}
if (this.gs.isDesktop || force) {
return this.toast.info(message, title, override);
Expand All @@ -56,7 +56,7 @@ export class ToastService {

error(message?: string, title?: string, override?: Partial<IndividualConfig>, force = false): ActiveToast<any> {
if (force) {
this.notif.addNotif(null, new Date().getTime(), 'danger', title, message);
this.notif.addNotif(null, Date.now(), 'danger', title, message);
}
if (this.gs.isDesktop || force) {
return this.toast.error(message, title, override);
Expand Down
2 changes: 1 addition & 1 deletion src/app/_shared/services/winbox.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class WinboxService {
!this.gs.includesOneOf(uriUrl, ['ftp://', 'mailto:'])) ||
force
) {
const currentDateTime = new Date().getTime();
const currentDateTime = Date.now();
this.openedWindow[currentDateTime] = new WinBox(uriUrl, {
id: currentDateTime,
title: uriUrl,
Expand Down

0 comments on commit 9db51f8

Please sign in to comment.