react-onchange-date-formatter
v1.0.11
Published
A date formatter package for react
Downloads
12
Maintainers
Readme
��#� �r�e�a�c�t�-�o�n�c�h�a�n�g�e�-�d�a�t�e�-�f�o�r�m�a�t�t�e�r�
�
�
�
�A� �s�i�m�p�l�e� �d�a�t�e� �f�o�r�m�a�t�t�e�r� �f�o�r� �r�e�a�c�t� �a�p�p�s�
�
�
�
�#� �i�n�s�t�a�l�l�a�t�i�o�n�
�
�
�
��
��
�
�n�p�m� �i� �r�e�a�c�t�-�o�n�c�h�a�n�g�e�-�d�a�t�e�-�f�o�r�m�a�t�t�e�r�
�
�
��
�
�
�
�
�#� �p�r�o�p�s�
�
�
�
�-� � � �e�:� �E�v�e�n�t� �o�n� �o�n�C�h�a�n�g�e�.�
�
�-� � � �s�e�t�S�t�a�t�e�:� �S�t�a�t�e� �u�p�d�a�t�e�r�.�
�
�-� � � �s�p�e�c�i�a�l�C�h�a�r�a�c�t�e�r�:� �A�n�y� �s�p�e�c�i�a�l� �c�h�a�r�a�c�t�e�r� �t�h�a�t� �y�o�u� �w�a�n�t� �t�o� �f�o�r�m�a�t� �t�h�e� �d�a�t�e�.�
�
�
�
�#� �U�s�a�g�e� �E�x�a�m�p�l�e�
�
�
�
��
��j�s�x�
�
�i�m�p�o�r�t� �R�e�a�c�t�,� �{� �u�s�e�S�t�a�t�e� �}� �f�r�o�m� �"�r�e�a�c�t�"�;�
�
�i�m�p�o�r�t� �u�s�e�F�o�r�m�a�t�D�a�t�e� �f�r�o�m� �"�r�e�a�c�t�-�o�n�c�h�a�n�g�e�-�d�a�t�e�-�f�o�r�m�a�t�t�e�r�"�;�
�
�
�
�e�x�p�o�r�t� �d�e�f�a�u�l�t� �f�u�n�c�t�i�o�n� �A�p�p�(�)� �{�
�
� � � � �c�o�n�s�t� �[�d�a�t�e�,� �s�e�t�D�a�t�e�]� �=� �u�s�e�S�t�a�t�e�(�"�"�)�;�
�
�
�
� � � � �c�o�n�s�t� �f�o�r�m�a�t�D�a�t�e� �=� �u�s�e�F�o�r�m�a�t�D�a�t�e�(�)�;�
�
�
�
� � � � �/�/� �T�h�i�s� �c�a�n� �b�e� �"�-�"�,� �"�/�"�,� �"� �"�,� �"�.�"�,� �"�|�"� �e�t�c�
�
� � � � �c�o�n�s�t� �s�p�e�c�i�a�l�C�h�a�r�a�c�t�e�r� �=� �"�/�"�;�
�
�
�
� � � � �c�o�n�s�t� �h�a�n�d�l�e�D�a�t�e�C�h�a�n�g�e� �=� �(�e�)� �=�>� �{�
�
� � � � � � � � �f�o�r�m�a�t�D�a�t�e�(�e�,� �s�e�t�D�a�t�e�,� �s�p�e�c�i�a�l�C�h�a�r�a�c�t�e�r�)�;�
�
� � � � �}�;�
�
�
�
� � � � �r�e�t�u�r�n� �(�
�
� � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � �<�i�n�p�u�t�
�
� � � � � � � � � � � � � � � � �t�y�p�e�=�"�t�e�x�t�"�
�
� � � � � � � � � � � � � � � � �p�l�a�c�e�h�o�l�d�e�r�=�"�1�0�/�1�0�/�2�0�2�3�"�
�
� � � � � � � � � � � � � � � � �v�a�l�u�e�=�{�d�a�t�e�}�
�
� � � � � � � � � � � � � � � � �o�n�C�h�a�n�g�e�=�{�h�a�n�d�l�e�D�a�t�e�C�h�a�n�g�e�}�
�
� � � � � � � � � � � � �/�>�
�
� � � � � � � � �<�/�d�i�v�>�
�
� � � � �)�;�
�
�}�
�
�
��
�
�
�
�
�#� �n�p�m� �l�i�n�k�
�
�
�
�h�t�t�p�s�:�/�/�w�w�w�.�n�p�m�j�s�.�c�o�m�/�p�a�c�k�a�g�e�/�r�e�a�c�t�-�o�n�c�h�a�n�g�e�-�d�a�t�e�-�f�o�r�m�a�t�t�e�r�
�
�