Skip to content

Commit

Permalink
[FieldFormatters] show units of human-readable approximate with momen…
Browse files Browse the repository at this point in the history
…t's i18n (elastic#101002)
  • Loading branch information
d1v1b committed Jun 6, 2021
1 parent b8a7e56 commit 17b5d48
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class DurationFormat extends FieldFormat {
const duration = parseInputAsDuration(val, inputFormat) as Record<keyof Duration, Function>;
const formatted = humanPrecise
? formatInputHumanPrecise(val, inputFormat, outputPrecision, useShortSuffix, includeSpace)
: duration[outputFormat]();
: duration.locale(i18n.getLocale())[outputFormat]();

const precise = human || humanPrecise ? formatted : formatted.toFixed(outputPrecision);
const type = outputFormats.find(({ method }) => method === outputFormat);
Expand Down

0 comments on commit 17b5d48

Please sign in to comment.