Created
February 16, 2017 07:02
-
-
Save joelalejandro/9ee6c682f1024718064d1f4d24511c5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convertToFullYear(partialYear) { | |
| let year = Number(partialYear); | |
| const fullYear = new Date().getFullYear(); | |
| if (year >= 69 && year <= 99) { | |
| year += (Math.floor(fullYear / 100) - 1) * 100; | |
| } else { | |
| year += Math.floor(fullYear / 100) * 100; | |
| } | |
| return year; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment