https://github.com/bell-kevin/thecouponcode
Story Your online store likes to give out coupons for special occasions. Some customers try to cheat the system by entering invalid codes or using expired coupons. Task Your mission: Write a function called checkCoupon which verifies that a coupon code is valid and not expired. A coupon is no more valid on the day AFTER the expiration date. All dates will be passed as strings in this format: "MONTH DATE, YEAR". Examples: checkCoupon("123", "123", "July 9, 2015", "July 9, 2015") === true checkCoupon("123", "123", "July 9, 2015", "July 2, 2015") === false
https://github.com/bell-kevin/thecouponcode
codewars-kata-solution
Last synced: over 1 year ago
JSON representation
Story Your online store likes to give out coupons for special occasions. Some customers try to cheat the system by entering invalid codes or using expired coupons. Task Your mission: Write a function called checkCoupon which verifies that a coupon code is valid and not expired. A coupon is no more valid on the day AFTER the expiration date. All dates will be passed as strings in this format: "MONTH DATE, YEAR". Examples: checkCoupon("123", "123", "July 9, 2015", "July 9, 2015") === true checkCoupon("123", "123", "July 9, 2015", "July 2, 2015") === false
- Host: GitHub
- URL: https://github.com/bell-kevin/thecouponcode
- Owner: bell-kevin
- License: gpl-3.0
- Created: 2022-06-28T02:13:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T22:49:43.000Z (almost 4 years ago)
- Last Synced: 2025-01-23T16:48:32.162Z (over 1 year ago)
- Topics: codewars-kata-solution
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# theCouponCode
Story Your online store likes to give out coupons for special occasions. Some customers try to cheat the system by entering invalid codes or using expired coupons. Task Your mission: Write a function called checkCoupon which verifies that a coupon code is valid and not expired. A coupon is no more valid on the day AFTER the expiration date. All dates will be passed as strings in this format: "MONTH DATE, YEAR". Examples: checkCoupon("123", "123", "July 9, 2015", "July 9, 2015") === true checkCoupon("123", "123", "July 9, 2015", "July 2, 2015") === false
== We're Using GitHub Under Protest ==
This project is currently hosted on GitHub. This is not ideal; GitHub is a
proprietary, trade-secret system that is not Free and Open Souce Software
(FOSS). We are deeply concerned about using a proprietary system like GitHub
to develop our FOSS project. We have an
[open {bug ticket, mailing list thread, etc.} ](INSERT_LINK) where the
project contributors are actively discussing how we can move away from GitHub
in the long term. We urge you to read about the
[Give up GitHub](https://GiveUpGitHub.org) campaign from
[the Software Freedom Conservancy](https://sfconservancy.org) to understand
some of the reasons why GitHub is not a good place to host FOSS projects.
If you are a contributor who personally has already quit using GitHub, please
[check this resource](INSERT_LINK) for how to send us contributions without
using GitHub directly.
Any use of this project's code by GitHub Copilot, past or present, is done
without our permission. We do not consent to GitHub's use of this project's
code in Copilot.
