8000 fix(BFormSelect): array of numbers or dates by xvaara · Pull Request #1839 · bootstrap-vue-next/bootstrap-vue-next · GitHub
[go: up one dir, main page]

Skip to content

fix(BFormSelect): array of numbers or dates #1839

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

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/bootstrap-vue-next/src/composables/useFormSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default (options: MaybeRefOrGetter, props: Record<string, unknown>) => {
if (typeof option === 'string') {
return {value: option, text: option}
}
if (typeof option === 'number') {
return {value: option, text: `${option}`}
}
if (option instanceof Date) {
return {value: option, text: option.toLocaleString()}
}

const value: unknown = get(option, props.valueField as string)
const text: string = get(option, props.textField as string)
Expand Down
0