How to customize keyboard input and format? - reactjs

I've upgraded from material-ui-pickers 2.x to #material-ui/pickers 3.x (both with #date-io/moment). And now I'm struggling with the keyboard input and format.
With version 2.x I used format="D.M.YYYY". The user was able to type for example 1.1.2000 or 04.08.2000 or 12.12.2000.
But with version 3.x the input only strictly allows 1.1.2000. It's not possible to have 2-digit day or month. Though I changed to format="DD.MM.YYYY", but now it's impossible to input 1-digit day or month without a leading zero. E.g. typing 1.1.2000 results in 11.20.00.
How can I achieve one (or both) of the following behaviors?
User can input whatever he wants, including characters (same behavior as with version 2.x). Or:
Listen for . input and then jump to the next input section. I.e. User types 1.2.2000 and it will set 1 for day, then jump to the month section, because user pressed . key, then set 2 for month, then jump to year section, because user pressed . and then set 2000 for year.

I found a kinda hacky solution for case 1 using refuse and rifmFormatter:
<KeyboardDatePicker
refuse={/[^\d\.]+/gi}
rifmFormatter={value => value.replace(/[^\d\.]+/gi, '')}
format={"D.M.YYYY"}
...
/>
This will only allow digits and dot as input in any order, and removes input masking.
Not the optimal solution, but way better than before.

Related

What line changed in a PDSE member?

Earlier today, I changed a source-member in a PDSE in z/OS 2.2. I can see from Data Set List Utility that it was changed by me today.
Name Prompt Size Created Changed ID
MYPROGRM 50 2021/09/08 2022/07/26 11:44:03 MYUSRID
When browsing the source-member, I can see that some of the lines have a date on the far-right side of the screen, but they don't appear to be consistent. If I manually change a line, it doesn't always update that date.
RUNSTATS TABLESPACE XXXX.YYYYYY
TABLE(ALL) INDEX(ALL) 00011004
SHRLEVEL REFERENCE
Is there any way to tell what lines of my PDSE member where changed (for instance) today?
Thank you for your help!
Dave
You might be able to see what lines were changed or added but not deleted. If you have 'STATS ON' and sequence numbers on for the member you are editing, then the sequence numbers on the far right of the screen correspond to the MM values for the member:
VV.MM Version number and modification level. The version number is set
to 1 and the modification level is set to 0 when the member is
created. The modification level is the number of times this version
has been modified. For example, 02.15 means version 2, modification
15. If a member name is just an alternate name for another member, ALIAS appears in this field.
https://www.ibm.com/docs/en/zos/2.2.0?topic=statistics-member-list-display-panel-fields
The standard sequence field is the last 8 characters for fixed-length
records, or the first 8 characters for variable-length records,
regardless of the programming language. Use NUMBER ON STD to generate
sequence numbers in the standard sequence field. For members of
partitioned data sets, the format of standard sequence numbers depends
on whether statistics are being generated. If statistics are being
generated, standard sequence numbers are 6 digits followed by a
2-digit modification level number. The level number flag reflects the
modification level of the member when the line was created or last
changed. If, for example, a sequence number field contains 00040002,
the line was added or last changed at modification level 02. The
sequence number is 000400.
If STATS mode is off, or if you are editing a sequential data set,
standard sequence numbers are 8 digits, right-justified within the
field.
https://www.ibm.com/docs/en/zos/2.1.0?topic=numbers-sequence-number-format-modification-level
So if this is true for the member you are editing, and you want to know what was a changed in the last edit session, then check the Modification level of the member in question in the member display list (you may have to scroll left or right):
Name Prompt Size Init Mod VV MM ID
_________ TEST *Edited 8 7 2 01.02 JOCS065
**End**
aadn you can see the 00, 01, 02 etc. MM levels in columns 79-80
****** ***************************** Top of Data ******************************
000100 my data 00010000
000200 my data 00020000
000300 my data 00030000
000400 my data 00040000
000500 my data 00050000
000510 more data 00051001
000600 my changed data 00060002
000700 my data 00070000
****** **************************** Bottom of Data ****************************
so to see only what was last changed (useful in a large dataset), get the MM level (e.g. 45) end then, when editing, run the commands x all;f '45' 79 all
Those characters in positions 72 - 80 are not necessarily dates. They could be, but if they are it's because someone manually made that true. ISPF Edit does not enforce that.
It's more likely that at some point someone turned NUMBER ON on the member, or that some of the lines were copied from another member that at some point had NUMBER ON turned on.
To your question, it is common for HSM backups to be made of datasets when they are changed. You may be able to recover a recent backup of your PDSE to a different name and then use the compare ISPF Edit primary command to compare the two versions and determine what changed.
There is no way to tell which lines were changed by looking at the file. The number in far-right of the screen is likely a sequence number. If other lines in your file do not have similar numeric values it is likely that your profile is set to NUMEBR OFF.
To see your profile type prof command on the ISPF editor command line, it should display information similar to this:
> Command ===> prof Scroll ===> CSR
****** ***************************** Top of Data ******************************
=PROF> ....C (FIXED - 80)....RECOVERY ON....NUMBER ON STD......................
=PROF> ....CAPS OFF....HEX OFF....NULLS ON STD....TABS OFF.....................
=PROF> ....AUTOSAVE ON....AUTONUM ON....AUTOLIST OFF....STATS ON...............
=PROF> ....PROFILE UNLOCK....IMACRO NONE....PACK OFF....NOTE ON................
=PROF> ....HILITE C LOGIC PAREN CURSOR FIND MARGINS(1,72)......................
That will tell you if sequence numbers are ON or OFF. If you want to get rid of sequence numbers you can use do the following sequence of commands: num followed by unnum command, otherwse if you want sequence nymbers use just the num command.

How can I make angular-bootstrap datepicker accept 2 or 4 digit year input?

I've got a uib-datepicker-popup defined like this: uib-datepicker-popup="M!/d!/yy"
It works great except when I enter a 4 digit year. In that case, it seems to make my ng-model undefined. Is there any way to accept either a 4 digit year or a 2 digit year?
uib-datepicker-popup="M!/d!/yyyy"
You have to choose the exact mask that you want, otherwise it will not update the model.
in a slack conversation on Angular Buddies, I got word back from one of the authors of the angular-bootstrap datepicker code in question, and the answer is that feature (supporting both 'yy' and 'yyyy') is not supported. You have to pick one or the other. Recommended to use 'yyyy' so there is no chance of getting confused by the century, but the default century picked for 'yy' seems decent at least as of right now circa 2016.

angular-strap timepicker saves different time

I am using angular-strap to save date and time for a project, but the time being displayed is not the same time being saved. I can not find any information anywhere on fixing this issue. Has anyone else had this problem?!
Screen shot of data
The value 2015-04-21T09:00:00.000Z means we are talking about the specific point in time described as "The 21. of April in the year 2015, at 9 o'clock UTC". That is, it includes a time zone denoted by the trailing Z. The timepicker you use automatically presents that value to the user, the exact same point in time, but takes the time zone his system is set to into account.
TL;DR The value is correct. Use this value for calculations and store this value in your database. Whenever you present this value to a user, convert it to his time zone.

Orbeon calendar behavior

when using a calendar (input with a bind to a date), is there a way to control the interpretation of the input ?
For what I've seen:
1-31 will be the nth of the current month
32-99 is n day after the first of the current month
x0y is the yth day of xth month of the current year
Then it's a little random
511950 will give 05/01/2050
but 151950 will give 01/05/2050
From what i gathered, the control tries to interpret some symbols (any symbol, this includes digits) as separators.
So for example, 151950 is 1/1/50 instead of 1/5/1950 and because it's more than 50 years, the '50' is translated as 2050 instead of 1950.
This is pretty confusing for users, specially when they explicitly put the year with 4 digits and not only 2.
So i'm looking for a way to be a lot stricter. For instance only allowing the dd/mm/yyyy format (with explicit separators). The rest would render the value invalid instead of trying to translate it in something it is not.
Is there a way to do that ?
We're using Orbeon 3.8, and our forms are mostly in french, so dd/mm order.
The parsing is done with regular expressions. See the code here. (To be fair: this code is old!)
I suspect that the overflow conditions are simply a product of the JavaScript date object.
The only way to change this behavior as far as I know is to change the JavaScript code.

Mobiscroll datetime, remove all validation

I'm prototyping this date picker with a client. They are finding it very confusing that you need to pick year first before other months and days become available for selection (which is fair enough).
We do date validation on the backened anyway, so is there anyway to remove the disabling of invalid dates so the user can choose anything they want immediately, instead of following the required pattern of year -> month -> day selections.
I couldn't find anything in the docs.
This was resolved by not including maxDate, even if it was null

Resources