0

Date of Birth? manually entry

hi, 

i have to set DOB but I found that on apple app, we I touch date field always display calendar to add a date, that is too annoying when you must set for example 1953 as year of birth, you can't go back all this months until the desire year. So, how to simplify DOB entry? 

Thanks in advance 

3 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    While the calendar pops up, you can still type in the box to enter in the date desired. Just be aware that it is picky about how you enter data. On my English US system, I can not type in:

    4/4/1980

    I have to type in:

    Apr 4 1980

    Another way if you don't want the calendar to pop up at is to use a text field where you enter in the data then use the Trigger after update to convert the text into a date field and copy that over to the the DOB date field.

      • Cirugia_Toracica
      • 1 yr ago
      • Reported - view

      Fred thanks for response

      we I tap once on a mobil device the calendar popup, and if I tap twice the mobile keyboard and the calendar block me the way to enter manually (is possible on desktop app or web). 

      how I use a text field and use trigger after update to convert text into a date field?

      thanks

    • Fred
    • 1 yr ago
    • Reported - view

    I don't use the mobile apps too much, so I don't have much experience with it.

    On the Mac app, I can enter in date date directly into the date fields I have.

    To use another field you:

    1) create a new text field, maybe EnterDate. My solution is not robust at all. It will not do any error checking on the text field. People can enter in anything they want and my code will try to parse it and of course fail if people don't enter in data that matches my code.

    2) put this in the Trigger after update:

    let xY := number(substring(EnterDate, 0, 4));
    let xM := number(substring(EnterDate, 5, 7));
    let xD := number(substring(EnterDate, 8, 10));
    Date := date(xY, xM, xD)

    I'm assuming that the date will be entered in as YYYY-MM-DD. If it isn't then this all breaks down.

    The first three lines takes the data in our new field EnterDate and the first variable (xY) finds the year and converts it into a number, because the field is text and thus it treats the results as text. Then it finds the month and day and converts them into numbers as well. It uses the substring function where we can take a string and find the characters that match the part of the string we want. So the year data occupies the first four spots thus we ask for the characters starting at 0 and ending before 4. Ninox always starts at 0. We know the - is at spot 4, so for the month we say start at 5 and end before 7 and we get the month. And so on for the day.

    Line 4 then says to set the field Date (change it to match your date field name) to the date that is made up of the three variables we just created.

Content aside

  • 1 yr agoLast active
  • 3Replies
  • 91Views
  • 2 Following