skill-sample-nodejs-first-skill
skill-sample-nodejs-first-skill copied to clipboard
Fixed the year calculation edge case.
Issue: The nextBirthday variable is updated with currentYear +1 but the currentYear variable in itself is not updated. This will lead to an error in the output given by Alexa when the user's birthday is in the next year because the output is generated using year - currentYear.
Description of Change: Created a new variable called nextYear. It is by default set to currentYear and incremented when a user's birthday exceeds the current time of the year. This nextYear variable is used for age calculation instead of the currentYear variable.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.