NativeScript / NativeScript/plugins

Calendar Displays Twice when setting MinDate from JS

Open
#153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

I'm using the following code to set the MinDate, based on the date from another datetimepicker:-

<datetime:DatePickerField id="enddate" locale="en_GB" row="0" col="2" hint="Select End Date" class="date" isEnabled="false" datePickerClosed="setenddate" datePickerOpened="onEndDateTap"/>

export function onEndDateTap(args){ var startdate = args.object.page.getViewById("startdate"); var leavestart = new Date(startdate.text); DateTimePicker.pickDate({ minDate: leavestart }) }

Whether I use tap or datePickerOpened, the calendar is displaying twice, one on top of the other. The Custom version from code displays on top, with a non custom version below. I have to click a date on each for them to both close.

NS 8.0.2
@nativescript/datetimepicker 2.1.6
iOS and Android

https://user-images.githubusercontent.com/6585298/129018701-4e6a9cd5-0013-4132-97b7-2e4464ae9f9f.mp4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the shown onEndDateTap handler and DateTimePicker.pickDate({ minDate: leavestart }) with @nativescript/datetimepicker 2.1.6 on iOS and Android. Investigate why setting MinDate opens a second calendar, and confirm that selecting a date closes a single calendar without duplicate UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, ios, javascript, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.