Date Picker Wheel only shows the past date

in this project, I want to ask the user to select a date from future years and retrieve the date to another screen.
 

The retrieving part works well but I cant adjust the date picker wheel to display future years.

I already change the part to add 100 years in the future and the labels but the system returns  error.

Please help.

Thank you

No. That isn’t what I asked you to upload.   Upload a runable project. I don’t have time to write a project for you.

Include main.lua, config.lua, build.settings, and any support file you need.

This sample should VERY short and simple, just including the code needed to demonstrate your issue, but it must run. 

PS - It can run and produce error message, but I want to drop main.lua on the simulator, then jump into debug.

**UPDATED**
 
I got tired of waiting and did the following:

  1. Downloaded your zip file.
  2. Downloaded original project.
  3. Created folder with this content:
  • 1_DatePicker-master - Original code you mentioned in first post.
  • 2_help me - Your code.  Not sure how you run this.
  • 3_example - A copy of ‘1_DatePicker-master’ that has been modified to show past and future years.

Code is attached below.
 
I only show the past 10 and future 10 years.
 
I edited datePickerWheel.lua and changed this:

-- Add the last 100 years. local years = {} local currYear = tonumber(os.date("%Y")) + 1 for i = 100, 1, -1 do years[i] = currYear - i end

to this:

-- Add the past 10 years and the next 10 years. 100 years is going to make the control very bloated. local yearsBeforeAfter = 10 local years = {} local currYear = tonumber(os.date("%Y")) + 1 + yearsBeforeAfter for i = (2\*yearsBeforeAfter), 1, -1 do years[i] = currYear - i end

I then edited example.lua

changing this:

 if time \> os.time() then native.showAlert("Date Picker", "You cannot choose a date in the future.", {"OK"}) return false end

to this:

 --[[if time \> os.time() then native.showAlert("Date Picker", "You cannot choose a date in the future.", {"OK"}) return false end --]]

If you downloaded this in the last few minutes, get it again.  I just changed example.lua too.

sorry for the inconvenience… hope this one is right.

just tap the black rectangle, it is supposed to listen and display the date picker wheel but now it only displays error

I downloaded you file. Let me try it

Thank you so much, roaminggamer !!! and rob miracle too

it worked welll ! Thank god! Thank you so much for helping