1.0.2 • Published 4 months ago

joplin-plugin-timewise-countdown v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Latest Release Contributors Forks Stargazers Issues project_license #top

About The Project

Demo

TimeWise Counter is a plugin that continually calculates and displays the time remaining until a specified deadline or the time elapsed since a specified start date. It allows easy customization and formatting.

Built With

  • TypeScript
  • Joplin

Usage

TimeWise Counter identifies special deadline or count-up markers in your text and replaces them with a live countdown or count-up. The markers follow these formats:

[output](d[DEADLINE]{TEMPLATE})
[output](u[STARTDATE]{TEMPLATE})
  • output: The parsed template output
  • DEADLINE or STARTDATE: The target time; if this date/time has passed for deadlines, the plugin shows zeros. For count-ups, it shows the time elapsed since the start date.
    • Supported formats:
      1. year-month-day:hour-minute (e.g., 2025-12-31:13-45)
      2. year-month-day (e.g., 2025-12-31)
      3. hour-minute (e.g., 13-45)
      4. Short years (less than 100) are interpreted as 20xx. For example, 25-12-31 -> 2025-12-31.
  • TEMPLATE: Specifies how the remaining or elapsed time should be displayed. Separate tokens with underscores ( _ becomes a space).

Template Tokens

Each letter indicates how to count down or up:

  • y = Years
  • m = Months
  • w = Weeks
  • d = Days
  • H = Hours
  • M = Minutes

All non-token text (e.g., years, days, minutes) remains literal. For example:

y_years_d_days_M_minutes

could output something like 1 years 9 days 30 minutes.

Examples

  1. Full Date-Time Deadline

    [](d[2025-01-10:14-00]{y_years_d_days_H_hours})
    • Suppose today is 2024-01-01 00:00.
    • This might display: [1 years 9 days 14 hours](d[2025-01-10:14-00]{y_years_d_days_H_hours})
  2. Full Date-Time Count-Up

    [](u[2023-01-01:00-00]{y_years_d_days_H_hours})
    • Suppose today is 2024-01-01 00:00.
    • This might display: [1 years 0 days 0 hours](u[2023-01-01:00-00]{y_years_d_days_H_hours})
  3. Date Only Deadline

    [](d[2025-01-10]{m_months_d_days})
    • With a current date of 2024-01-01, you might see: [12 months 9 days](d[2025-01-10]{m_months_d_days}).
  4. Date Only Count-Up

    [](u[2023-01-01]{m_months_d_days})
    • With a current date of 2024-01-01, you might see: [12 months 0 days](u[2023-01-01]{m_months_d_days}).
  5. Time Only Deadline

    [](d[15-30]{H_hours_M_minutes})
    • If it's currently 09:00, it could show: [6 hours 30 minutes](d[15-30]{H_hours_M_minutes}).
  6. Time Only Count-Up

    [](u[09-00]{H_hours_M_minutes})
    • If it's currently 15:30, it could show: [6 hours 30 minutes](u[09-00]{H_hours_M_minutes}).
  7. Short Year Deadline

    [](d[25-01-01]{y_years_m_months})
    • Interpreted as 2025-01-01, so if we're in 2024-01-01, that might be: [1 years 0 months](d[25-01-01]{y_years_m_months}).
  8. Short Year Count-Up

    [](u[23-01-01]{y_years_m_months})
    • Interpreted as 2023-01-01, so if we're in 2024-01-01, that might be: [1 years 0 months](u[23-01-01]{y_years_m_months}).
  9. Week Calculation Deadline

    [](d[2024-02-15]{w_weeks_d_days})
    • If only a few weeks remain until Feb 15, 2024, this might read: [2 weeks 3 days](...).
  10. Week Calculation Count-Up

    [](u[2023-12-01]{w_weeks_d_days})
    • If a few weeks have passed since Dec 1, 2023, this might read: [2 weeks 3 days](...).
  11. Past Deadlines

    • If the deadline is in the past, all tokens become zero, e.g.:
    [](d[2023-12-31]{y_years_d_days_H_hours})

    becomes:

    [0 years 0 days 0 hours](d[2023-12-31]{y_years_d_days_H_hours})

Build

Prerequisites

Make sure you have Node.js (and npm) installed.

npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://gitlab.com/flxholle/timewise-countdown.git
  2. Install NPM packages
    npm install
  3. Build the plugin: The plugin is built using Webpack, which creates the compiled code in /dist

    npm run dist

Contributing

Contributions make open source amazing. If you have an idea or fix, please:

  1. Fork the Project
  2. Create a new branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for details.

Contact

Felix Hollederer - @flxholle - flxholle@posteo.com

Project Link: https://gitlab.com/flxholle/timewise-countdown

Acknowledgments

  • Joplin for a great note-taking platform
1.0.2

4 months ago

1.0.1

7 months ago

1.0.0

7 months ago