Gathering detailed insights and metrics for ebx-timezone-mock
Gathering detailed insights and metrics for ebx-timezone-mock
Gathering detailed insights and metrics for ebx-timezone-mock
Gathering detailed insights and metrics for ebx-timezone-mock
A JavaScript library to mock the local timezone
npm install ebx-timezone-mock
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
2 Stars
42 Commits
8 Watchers
3 Branches
4 Contributors
Updated on Jan 06, 2023
Latest Version
1.1.4
Package Id
ebx-timezone-mock@1.1.4
Unpacked Size
37.30 kB
Size
8.24 kB
File Count
13
NPM Version
6.0.1
Node Version
8.9.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A JavaScript library which mocks the Date
object and lets you specify a local date/time/timezone in order to enable consistent testing of date/time-related code independently of your local system time settings.
It works by monkey patching the Date
object and returning results which are adjusted to reflect the effects of both the specified current date/time/timezone (if any) and the current date/time/timezone. In particular, it avoids problems caused by certain JavaScript date/time methods e.g. getHours
returning results in the user's local system time, so you can write date/time-related unit tests which will work whenever and wherever they are run, without changing timezones causing results to change.
1$ npm install ebx-timezone-mock
1import TimezoneMock from 'TimezoneMock'; 2 3TimezoneMock.set('2018-04-25T12:34:56.000Z'); 4 5console.log(new Date()); // Wed Apr 25 2018 12:34:56 GMT+0000 (GMT Standard Time) 6 7TimezoneMock.reset(); 8 9console.log(new Date()); // Current system date/time/timezone
The majority of the code for this project was taken from the timezone-mock project by Jimb Esser, with some additional code from the MockDate project by Bob Lauer. My contribution has been limited to gluing these two projects together, and introduction moment-timezone to solve the problem of working out the timezone offset for any given date, time and place.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
54 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More