1.0.22 • Published 2 years ago

@phankiet/react-native-week-selector v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-week-selector

Usage

import {
  IRangeDateSelectorItem,
  RangeDateSelector,
} from "@phankiet/react-native-week-selector";

<RangeDateSelector
  type={"week"}
  onConfirm={handleChangeWeek}
  weekLabel={t("weekLabel")}
  closeText={t("close")}
  confirmText={t("confirm")}
>
  <View style={[styles.pickerWrapper, { flex: 3 }]}>
    <View style={styles.labelDate}>
      <Text style={styles.pickerText}>{"Select week"}</Text>
      <IonIcon name={"chevron-down"} size={18} color={colors.orangePrimary} />
    </View>
  </View>
</RangeDateSelector>;

Properties

NameTypeDefaultRequiredDescription
childrennodenonetrueThe interface when the user presses to select will display a popup
type"week" or "month""week"falseType of selector
weekLabelstring"Tuần"falseLabel of week item
formatDatestring"DD/MM"falseDate format of item
renderItem{ item: IRangeDateSelectorItem, index: number, selected: boolean }) => functionnodefalseItem UI
selectedColorstring"#ccc"false
buttonStyleViewStylefalse
buttonTextStyleTextStylefalse
yearTextStyleTextStylefalse
labelStyleViewStylefalse
labelTextStyleTextStylefalse
closeTextstring"Đóng"false
confirmTextstring"Xác nhận"false
currentYearnumbermoment().get("year")false
onConfirm(selected: IRangeDateSelectorItem) => functionnonefalse