Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editor): Add examples for Luxon DateTime expression methods #9361

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export const STRING_RECOMMENDED_OPTIONS = [
'length',
];

export const LUXON_RECOMMENDED_OPTIONS = ['format()', 'minus()', 'plus()', 'diff()', 'extract()'];
export const LUXON_RECOMMENDED_OPTIONS = ['format()', 'minus()', 'plus()', 'diffTo()', 'extract()'];
elsmr marked this conversation as resolved.
Show resolved Hide resolved
export const OBJECT_RECOMMENDED_OPTIONS = ['keys()', 'values()', 'isEmpty()', 'hasField()'];
export const ARRAY_RECOMMENDED_OPTIONS = ['length', 'last()', 'includes()', 'map()', 'filter()'];
export const ARRAY_NUMBER_ONLY_METHODS = ['max()', 'min()', 'sum()', 'average()'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ export const luxonInstanceOptions = ({
name: key,
isFunction,
docs: luxonInstanceDocs,
translations: i18n.luxonInstance,
includeHidden,
transformLabel,
}) as Completion;
Expand All @@ -778,7 +777,6 @@ export const luxonStaticOptions = () => {
name: key,
isFunction: true,
docs: luxonStaticDocs,
translations: i18n.luxonStatic,
}) as Completion;
})
.filter(Boolean),
Expand All @@ -788,14 +786,12 @@ export const luxonStaticOptions = () => {
const createLuxonAutocompleteOption = ({
name,
docs,
translations,
isFunction = false,
includeHidden = false,
transformLabel = (label) => label,
}: {
name: string;
docs: NativeDoc;
translations: Record<string, string | undefined>;
isFunction?: boolean;
includeHidden?: boolean;
transformLabel?: (label: string) => string;
Expand Down Expand Up @@ -835,8 +831,7 @@ const createLuxonAutocompleteOption = ({
option.info = createCompletionOption({
name,
isFunction,
// Add translated description
doc: { ...doc, description: translations[name] } as DocMetadata,
doc,
transformLabel,
}).info;
return option;
Expand Down
Loading
Loading