Calendar system by keypress?

hey guys so i have a feature for my game but im not sure how to implement it, i’ll try to explain the best i can

basically i want to have where you can enter dates and time with the numpad so you’d press a button to enable the date selector, then you’d enter month in 2 digits, day in 2 digits and then year in 4 digits and lastly press a button to submit it. it would then print the numbers to the screen, i’m not sure how to make this or account for things like leap years any help appreciated

this is what ive come up with for the month, but im not sure how i’d do the day or year. i followed a guide on making cheat codes and basically am printing the text for now

here is a basic on off switch to start recording the numbers pressed.
image

here i’m gathering the buttons, asking if the key to record buttons is on, and then letting it check.

lastly heres the “cheat index” from the tutorial basically numbers 00 - 99 and they are tied to 13 functions, (JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC and ERR for any number thats not 01-12)

i dont know how to kill an event and i really dont want to make functions for every number because once i get to year thats 1,000 functions to make by hand. any ideas much appreciated

can enter dates and time with the numpad so you’d press a button to enable the date selector

Even though it sounds clear, I can imagine this done in so many ways. Have you considered exploring an Editable Text widget for entry:

You can then use date time to do pretty much anything you need:

You could use date time with whatever method, actually. You may need to figure out some data formatting first, the above is just a pseudoscript example.


Some infamous gotchas:

unfortunately i dont know enough about widgets to even get started with that
edit: i messed around with datetime a bit, it doesnt support year 0 which i need and annoyingly doesnt support leading 0’s so i cant enter for instance 01,01,0000 for a date

Have you considered maybe combo boxes with drop down entries?

no because the feature has to be done with keypresses

so took about a week but i finally got it to a point im mostly happy with, i had to manually write out 10,000 years but it’ll soon be enterable. my only concern is once i have a working time input i wont be able to see the days, months and years roll over using this method

Hello! Please tell me how to do it according to the above script. I made it according to your script, but when I enter a value in Editable Text, date time from string keeps returning flase.

Show us your script, what I posted was just an example. It sounds likevthe date format you’re entering is not correct.

This is my script. When I enter a number at random, the result will always be 1/1/1 like the picture. I don’t understand why.Thank you for your reply
P3


As mentioned bove, DateTime needs specific format. Follow the link I posted above to see what I mean. You’re probably invalidating that node.


Most importantly, what’s the point of using Data Time if you’re reformatting the data anyway? Take the string apart, and pull what’s needed out of it directly.