Skip to content

aniqjaved01/Subscription-Management-Logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Subscription Managment Logic

This is a simple javascript script that checks the status of a user's subscription based on a start date and duration in months. It determines whether a subscription is active, ending today, or has already ended.

Features

  • Calculates the remaining days of a subscription
  • Differentiates between:
    • Active subscriptions
    • Subscriptions ending today
    • Expired subscriptions
  • Comes with test cases for validation

Usage

  1. Clone the repository or download the file task1.js.

  2. Run the script using Node.js:

    node task1.js
    

Example Output

Test Case (Expired): Your subscription has ended.
Test Case (Ending Soon): Your subscription is active. 2 day(s) remaining.
Test Case (Active): Your subscription is active. 259 day(s) remaining.
Test Case (Ending Today): Your subscription ends today.
Test Case (Short Subscription): Your subscription is active. 25 day(s) remaining.

Notes

Make sure your system date and time are accurate, as the script relies on new Date() for the current time.

All test cases use UTC date format for consistency.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published