Skip to content

Alternative #24

Description

@dadatuputi

For those coming here who need an alternative, you can simulate this plugin pretty closely and easily using the templater plugin and a element. Here's my template to create progress bars for my daily journals, bonus being that it maintains the date for the journal entry, instead of always showing the current date.

<%*
const journalDate = moment(tp.file.title, "YYYY-MM-DD");
const yearDay = journalDate.dayOfYear();
const year = journalDate.year();
const yearDays = journalDate.isLeapYear() ? 366 : 365;
const yearProgress = (100 * (yearDay / yearDays)).toFixed(0)
const monthDay = journalDate.format("D");
const month = journalDate.format("MMMM");
const monthDays = journalDate.daysInMonth()
const monthProgress = (100 * (monthDay / monthDays)).toFixed(0)
%>
Day <% monthDay %> of <% month %>:  <progress value=<% monthDay %> max=<% monthDays %>> </progress> <% monthProgress %>%
Day <% yearDay %> of <% year %>:  <progress value=<% yearDay %> max=<% yearDays %>> </progress> <% yearProgress %>%

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions