mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* Fix formatdate not allowing strings * Addressing Feedback
This commit is contained in:
parent
80038e3c8e
commit
5170349676
2 changed files with 6 additions and 3 deletions
|
@ -12,7 +12,7 @@ interface Arguments {
|
|||
format: string;
|
||||
}
|
||||
|
||||
export function formatdate(): ContextFunction<'formatdate', number, Arguments, string> {
|
||||
export function formatdate(): ContextFunction<'formatdate', number | string, Arguments, string> {
|
||||
const { help, args: argHelp } = getFunctionHelp().formatdate;
|
||||
|
||||
return {
|
||||
|
@ -20,7 +20,7 @@ export function formatdate(): ContextFunction<'formatdate', number, Arguments, s
|
|||
type: 'string',
|
||||
help,
|
||||
context: {
|
||||
types: ['number'],
|
||||
types: ['number', 'string'],
|
||||
},
|
||||
args: {
|
||||
format: {
|
||||
|
|
|
@ -11,9 +11,12 @@ import { FunctionFactory } from '../../functions/types';
|
|||
|
||||
export const help: FunctionHelp<FunctionFactory<typeof formatdate>> = {
|
||||
help: i18n.translate('xpack.canvas.functions.formatdateHelpText', {
|
||||
defaultMessage: 'Output a {ms} since epoch number as a formatted string',
|
||||
defaultMessage:
|
||||
'Format a valid date string or number of {ms} since epoch using {moment} (see {url})',
|
||||
values: {
|
||||
ms: 'ms',
|
||||
moment: 'momentJS',
|
||||
url: 'https://momentjs.com/',
|
||||
},
|
||||
}),
|
||||
args: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue