mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-18 10:00:55 -04:00
fix(curriculum): add more buffer time lab data conversion (#56606)
This commit is contained in:
@@ -43,13 +43,12 @@ assert.equal(currentDateOnly.toString(), expectedDateOnly.toString());
|
||||
You should have a variable named `currentDateFormat` that holds the current date in the format `Current Date and Time: <ddd> <MMM> <dd> <yyyy> <HH>:<mm>:<ss> <TIMEZONE>`.
|
||||
|
||||
```js
|
||||
const expectedDate = new Date();
|
||||
const expectedDateString = `Current Date and Time: `;
|
||||
assert.include(currentDateFormat, expectedDateString);
|
||||
|
||||
const currentTimestamp = new Date(currentDateFormat.replace(expectedDateString, '')).getTime();
|
||||
const expectedTimestamp = expectedDate.getTime();
|
||||
assert.approximately(currentTimestamp, expectedTimestamp, 1000);
|
||||
const expectedTimestamp = new Date().getTime();
|
||||
assert.approximately(currentTimestamp, expectedTimestamp, 2000);
|
||||
```
|
||||
|
||||
You should log the value of `currentDateFormat` to the console.
|
||||
|
||||
Reference in New Issue
Block a user