@@ -67,14 +67,14 @@ export const DateTimeInput = React.forwardRef<
6767 const [ selection , setSelection ] = useState < SelectionSegment > ( ) ;
6868
6969 /**
70- * Normalize pasted text by:
70+ * Normalize text by:
7171 * - Replacing 'T' with space to support ISO 8601 format
7272 * - Removing timezone information (e.g., "EDT", "+05:00", "Z")
7373 * - Adding zero-width space separators in the nanosecond part
74- * @param text The pasted text
74+ * @param text The text
7575 * @returns The normalized text
7676 */
77- const normalizePastedText = useCallback ( ( text : string ) : string => {
77+ const normalizeText = useCallback ( ( text : string ) : string => {
7878 // Replace first 'T' separator with space for ISO 8601 format (without global flag to preserve 'T' in timezone like EDT)
7979 let normalized = text . replace ( / T / , ' ' ) ;
8080
@@ -97,15 +97,15 @@ export const DateTimeInput = React.forwardRef<
9797 // Apply normalization to handle raw unformatted values (e.g., with timezone info)
9898 useEffect ( ( ) => {
9999 if ( defaultValue . length > 0 ) {
100- const normalized = normalizePastedText ( defaultValue ) ;
100+ const normalized = normalizeText ( defaultValue ) ;
101101 setValue ( normalized ) ;
102102 // Notify parent with the normalized value (without separators)
103103 onChange ( fixIncompleteValue ( removeSeparators ( normalized ) ) ) ;
104104 } else {
105105 setValue ( '' ) ;
106106 onChange ( '' ) ;
107107 }
108- } , [ defaultValue , normalizePastedText , onChange ] ) ;
108+ } , [ defaultValue , normalizeText , onChange ] ) ;
109109
110110 const handleChange = useCallback (
111111 ( newValue : string ) : void => {
@@ -134,7 +134,7 @@ export const DateTimeInput = React.forwardRef<
134134 className = { classNames ( className ) }
135135 example = { EXAMPLES }
136136 getNextSegmentValue = { getNextSegmentValue }
137- normalizePastedText = { normalizePastedText }
137+ normalizePastedText = { normalizeText }
138138 onChange = { handleChange }
139139 onSelect = { setSelection }
140140 onSubmit = { onSubmit }
0 commit comments