vault/ui/lib/core/addon/utils/timestamp.js
Vault Automation 0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00

20 lines
511 B
JavaScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
/**
* Use this instead of new Date() throughout the app so that time-related logic is easier to test.
*/
const timestamp = {
// Method defined within an object so it can be stubbed
/**
* * Use timestamp.now to create a date for the current moment. In testing context, stub this method so it returns an expected value
* @returns Date object
*/
now: () => {
return new Date();
},
};
export default timestamp;