By following Git commit messages Standard, See how a minor change to your commit message style, can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| const handleInputChange = (e) => { | |
| const value = e.target.value; | |
| const pageNumber = parseInt(value); | |
| setInputValue(pageNumber); | |
| if ( | |
| !isNaN(pageNumber) // checks if the entered pageNumber is a valid number | |
| && pageNumber > 0 // checks if the entered pageNumber is greater than 0 | |
| && pageNumber <= pageCount // checks if the entered pageNumber is less than or equal to the pageCount- (total number of pages) | |
| ) { | |
| setCurrentPage(pageNumber); | 
| // Utility Functions | |
| // TRUNCATES(SHORTENS) LONG STRINGS | |
| function truncate(str, n){ | |
| return (str.length > n) ? str.slice(0, n-1) + '...' : str; | |
| }; | |
| e.g truncate(title,30) | |
| // CONVERTS DOB FORMAT FROM ISO 8601 to DD-MMM-YYYY | |
| export const timeConverter = (UNIX_timestamp) => { |