Open PMExtra opened 6 years ago
There is another usage case:
Date between
-------------------
Recent 1 week
Recent 1 month
(picker) - (picker)
And I would implement that by options:
enum DateRange { week, month, custom }
const OPTIONS: DropdownOption[] = [{
value: DateRange.week,
title: "Recent 1 week",
}, {
value: DateRange.month,
title: "Recent 1 month",
}, {
value: DateRange.custom,
title: () => `${store.beginDate} - ${store.endDate}`, // For button title
render: ( // Just a schematic, omit the style
<View>
<DatePicker onValueChange={store.setBeginDate} />
<Text>-</Text>
<DatePicker onValueChange={store.setEndDate} />
</View>
),
}]
It's much easier than current.
I want to rewrite this project by typescript and add these features:
Make the options more powerful, I will add a type that:
then I can easily to make some dropdown like that:
It's a very typical usage case in online shop.
Support multiple selection.
I'd like to know how much you're interested in it, that affects whether I will open source or just for myself.