Files
cloudbeaver/webapp/packages/core-utils/src/withTimestamp.ts
T
bc7cd3b217 CB-4289 add file name param for data export (#2308)
* CB-4289 add file name param for data export

* CB-4289 pass file name based on context

* CB-4289 use existing export action

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: kseniaguzeeva <112612526+kseniaguzeeva@users.noreply.github.com>
2024-01-22 18:30:36 +03:00

15 lines
471 B
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export function withTimestamp(value: string) {
const now = new Date();
return `${value} ${now.toISOString().slice(0, 10)} ${('0' + now.getHours()).slice(-2)}-${('0' + now.getMinutes()).slice(-2)}-${(
'0' + now.getSeconds()
).slice(-2)}`;
}