I found this shell scripting tip site for doing original numbers. To use the function it suggests seems doable.

Here is the function it suggests for handling ordinals:

#!/bin/bash

function ordinal () {
  case "$1" in
    *1[0-9] | *[04-9]) echo "$1"th;;
    *1) echo "$1"st;;
    *2) echo "$1"nd;;
    *3) echo "$1"rd;;
  esac
}

I am sure that can be weaved into building the link string by passing it the day of the month.

Do you have the skills for incorporating this into building your link string?

1 Like

hi, I wanna know how to not display these connections between days and calendar in the Graph. I’ve tried script like ‘[[20200604|4]]’ and ‘[23](2020-08-23)’, there always have a line in the Graph.

If you have good method , plz tell me. thx.

1 Like

This kind of filtering is not yet possible. Soon!

1 Like

Hi @asun, glad you found it helpful. I made a quick update to allow insertion of the ordinal suffix by adding XX into the template string right after the day number (%d or %e etc.). See if it works for you - the default version in the gist has this in as an example.

I made a few other quick updates based on @Mike’s suggestions:

  • outputFile specifies the output filename, can be either a relative (just filename like calendar.md) or a full path
  • hlt provides the string to use for highlighting today’s date, e.g. ==

Note about the day number. You can use %e but that pads 1-digit numbers with a space. If you want the one digit day number without a leading zero you can use %-d

when I have more time I’ll come back to the other ideas.


Yep, also interested. Is there a way of linking that I didn’t notice and that doesn’t create backlinks?

See my reply to RyanWu :point_up:

2 Likes

Thanks :slight_smile:

Any way how to make it not depended on fixed naming convention?
I just edit script and add my ISO date formating and script should extract all the parts like: date, month day, a rebuild the note name when creating calendar.

I tried to edit current script with my ISO formatting:

linkformat="%ww' %DD-%MMM (%ddd) %Y"

But it create empty calendar.

how can I run it in Windows? :flushed:

1 Like

@jcperezh Because it uses date or gdate it will not run on windows natively. That are utilities only available on linux (or OSX)

You could try to install the Ubuntu (command line) from the windows store and run it from there.

Yes…that is what I did.

done! work great. im now trying to translate it to german (doesn’t work when the linux language is not English) this is my first attempt with .sh and i am trying to change the “Mon” and “Sun” with $hMon and $hSun so i can just translate the headers. not successful yet.

1 Like

@jcperezh That’s weird your approach should work. You have to change the other occurrences if “Mon” and “Sun” as well later in the code.

You are right, the language of the date command changes with the system language.
This can be prevented running the script a temporary environmental variable:

LANG=en_US ./md-cal.sh

Note: Don’t for get to make the script executable first: chmod +x ./md-cal.sh

done! i don’t know the syntax yet and didn’t use “$hSun”, just $hSun without the quotation marks :flushed: :roll_eyes:. it work perfect.

Edit: Now it is getting interesting, Week number in Europa and in USA are not the same…
Edit_2: %V instead of %W solved it (ISO Standard)


I created a link also to my Week-Note to the Week Number

3 Likes

Python script version (customizable) with KB script makro script!

3 Likes

I think it’s because the link is in a table. If you escape the pipe, it’s not gonna show: [[20200604\|4]] in preview mode.

Looks like a great change for the people in Europe :grinning:.
Would you mind sharing it?

Hi guys, I really want something like that. Sorry if the question is to stupid. I dont have any knolowge with this, but Im trying anyway to make this work here on Window. Can anyone help me?
I did these steps:

  • installed Ubuntu Command Line from windows store as suggested;
  • installed Windows Subsystem for Linux (WL2)
  • Set the startDate, endDate and dailyNotePath on script
  • Tried to execute md-cal.sh and got this:
    md-cal.sh: 96: function: not found
    md-cal.sh: 1: gdate: not found
    md-cal.sh: 105: Bad substitution

Can someone point me to some direction to solve this?
Thanks

on Linux u need to use “date” instead of gdate Screenshot_20200927-110219_File Manager +|690x140

1 Like

Thanks! My bad. I forgot that I was kind of using Linux on Windows