NepaliDateRangeTextField

fun NepaliDateRangeTextField(startValue: SimpleDate?, endValue: SimpleDate?, onRangeChange: (start: SimpleDate?, end: SimpleDate?) -> Unit, modifier: Modifier = Modifier, dateFormat: NepaliDateFormatter.Pattern = Pattern.YYYY_SLASH_MM_SLASH_DD, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultRangePickerLocale, startLabel: @Composable () -> Unit? = { Text(locale.language.startDate) }, endLabel: @Composable () -> Unit? = { Text(locale.language.endDate) }, supportingText: @Composable () -> Unit? = null, isStartError: Boolean = false, isEndError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, keyboardOptions: KeyboardOptions = KeyboardOptions( autoCorrectEnabled = false, keyboardType = KeyboardType.Number, imeAction = ImeAction.Next ), keyboardActions: KeyboardActions = KeyboardActions.Default, colors: TextFieldColors = OutlinedTextFieldDefaults.colors(), textStyle: TextStyle = LocalTextStyle.current, shape: Shape = OutlinedTextFieldDefaults.shape, startPrefix: @Composable () -> Unit? = null, endPrefix: @Composable () -> Unit? = null, startSuffix: @Composable () -> Unit? = null, endSuffix: @Composable () -> Unit? = null, startInteractionSource: MutableInteractionSource? = null, endInteractionSource: MutableInteractionSource? = null)(source)

Two stacked NepaliDateTextFields editing a Bikram Sambat date range.

Validation per keystroke is identical to NepaliDateTextField for each side, plus a cross-field rule: a parsed endValue < startValue is rejected - the field emits the offending side as null and surfaces isError = true to the caller via isStartError / isEndError.

The composable emits each side independently through onRangeChange; callers who want a single Pair<SimpleDate?, SimpleDate?> callback can wrap.

Parameters

startValue

externally-controlled start selection.

endValue

externally-controlled end selection.

onRangeChange

invoked on every keystroke. First arg is the new start (or unchanged); second is the new end. Both null means the user has not completed input on that side or it failed validation.

Text-field appearance is customizable through textStyle, shape, the per-field startPrefix / endPrefix, startSuffix / endSuffix, and the per-field startInteractionSource / endInteractionSource.

See also

for a combo that pairs this with the range picker dialog.