Skip to content

Commit

Permalink
chore: padstart
Browse files Browse the repository at this point in the history
padleft instead of right for more readable date
  • Loading branch information
jlangy committed Jul 2, 2024
1 parent 3820910 commit a247a7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions testing/cypress/appActions/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Handy utilities for the app
*/
import crypto from 'crypto';
import padEnd from 'lodash.padend';
import padStart from 'lodash.padstart';

class Utilities {
runOk(data: any): boolean {
Expand Down Expand Up @@ -36,13 +36,13 @@ class Utilities {
}
getDate(): string {
let today = new Date();
let dd: any = padEnd(today.getDate(), 2, '0');
let mm: any = padEnd(today.getMonth() + 1, 2, '0'); //January is 0!
let yyyy = padEnd(today.getFullYear(), 4, '0');
let hh = padEnd(today.getHours(), 2, '0');
let min = padEnd(today.getMinutes(), 2, '0');
let ss = padEnd(today.getSeconds(), 2, '0');
let ms = padEnd(today.getMilliseconds(), 3, '0');
let dd: any = padStart(today.getDate(), 2, '0');
let mm: any = padStart(today.getMonth() + 1, 2, '0'); //January is 0!
let yyyy = padStart(today.getFullYear(), 4, '0');
let hh = padStart(today.getHours(), 2, '0');
let min = padStart(today.getMinutes(), 2, '0');
let ss = padStart(today.getSeconds(), 2, '0');
let ms = padStart(today.getMilliseconds(), 3, '0');
return yyyy + mm + dd + hh + min + ss + ms;
}
getRandomInt(min, max) {
Expand Down
14 changes: 7 additions & 7 deletions testing/package-lock.json

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

2 changes: 1 addition & 1 deletion testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"crypto-js": "^4.2.0",
"cypress-real-events": "^1.10.3",
"lodash.kebabcase": "^4.1.1",
"lodash.padend": "^4.6.1",
"lodash.padstart": "^4.6.1",
"otplib": "^12.0.1",
"uuid": "^9.0.1"
}
Expand Down

0 comments on commit a247a7b

Please sign in to comment.