Skip to content

Instantly share code, notes, and snippets.

@boyte
Last active March 25, 2021 01:09
Show Gist options
  • Save boyte/13c8f09b4f00bde1407582698f172a2c to your computer and use it in GitHub Desktop.
Save boyte/13c8f09b4f00bde1407582698f172a2c to your computer and use it in GitHub Desktop.
scratchpad
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "scratchpad",
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/boyte/13c8f09b4f00bde1407582698f172a2c/scratchpad.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "lIYdn1woOS1n",
"colab": {}
},
"source": [
"import datetime\n",
"\n",
"def get_week_list(year, quarter):\n",
" \"\"\"\n",
" Print list of week pages for a quarter\n",
" \"\"\"\n",
" result = \"\"\n",
" start_week = (quarter - 1)*13 + 1;\n",
" for week_number in range(start_week, start_week+12):\n",
" display_string = f\"[W{week_number}]\"\n",
" link_string = f\"([[{year}-W{week_number}]])\"\n",
" result = result + display_string + link_string + \" || \"\n",
" result = result[:-3]\n",
" return result\n",
"\n",
"def get_day_list(year, week):\n",
" \"\"\"\n",
" Print list of day pages for a week\n",
" \"\"\"\n",
" result = \"\"\n",
" for day in range(1,8):\n",
" datetime_string = f\"{year}-{week}-{day}\"\n",
" datetime_object = datetime.datetime.strptime(datetime_string, '%G-%V-%u')\n",
" display_string = datetime_object.strftime(\"[%a %d]\")\n",
" link_string = custom_strftime('([[%B {S}, %Y]])', datetime_object)\n",
" result = result + display_string + link_string + \" || \"\n",
" result = result[:-3]\n",
" return result\n",
"\n",
"def suffix(d):\n",
" \"\"\"\n",
" Decide on 'th', 'st' or 'nd' for a given date\n",
" \"\"\"\n",
" return 'th' if 11<=d<=13 else {1:'st',2:'nd',3:'rd'}.get(d%10, 'th')\n",
"\n",
"def custom_strftime(format, t):\n",
" \"\"\"\n",
" Create a custom strftime that uses the proper suffix\n",
" \"\"\"\n",
" return t.strftime(format).replace('{S}', str(t.day) + suffix(t.day))\n"
],
"execution_count": 1,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "UJs401him7ij",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "97e14d1d-c6e6-44d0-f6d2-b8e545174ad1"
},
"source": [
"#Print everything for year 2020\n",
"\n",
"year = 2020\n",
"for quarter in range(1,5):\n",
" print(f\"-\"*17)\n",
" print(f\"--- Quarter {quarter} ---\")\n",
" print(f\"-\"*17)\n",
" print(\" \")\n",
"\n",
" print(get_week_list(year, quarter))\n",
" print(\" \")\n",
"\n",
" start_week = (quarter - 1)*13 + 1\n",
" end_week = start_week + 13\n",
" for week in range(start_week, end_week):\n",
" print(f\"Week {week}:\")\n",
" print(get_day_list(year, week))\n",
" print(\" \")\n",
" print(\" \")"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
"-----------------\n",
"--- Quarter 1 ---\n",
"-----------------\n",
" \n",
"[W1]([[2020-W1]]) || [W2]([[2020-W2]]) || [W3]([[2020-W3]]) || [W4]([[2020-W4]]) || [W5]([[2020-W5]]) || [W6]([[2020-W6]]) || [W7]([[2020-W7]]) || [W8]([[2020-W8]]) || [W9]([[2020-W9]]) || [W10]([[2020-W10]]) || [W11]([[2020-W11]]) || [W12]([[2020-W12]]) \n",
" \n",
"Week 1:\n",
"[Mon 30]([[December 30th, 2019]]) || [Tue 31]([[December 31st, 2019]]) || [Wed 01]([[January 1st, 2020]]) || [Thu 02]([[January 2nd, 2020]]) || [Fri 03]([[January 3rd, 2020]]) || [Sat 04]([[January 4th, 2020]]) || [Sun 05]([[January 5th, 2020]]) \n",
" \n",
"Week 2:\n",
"[Mon 06]([[January 6th, 2020]]) || [Tue 07]([[January 7th, 2020]]) || [Wed 08]([[January 8th, 2020]]) || [Thu 09]([[January 9th, 2020]]) || [Fri 10]([[January 10th, 2020]]) || [Sat 11]([[January 11th, 2020]]) || [Sun 12]([[January 12th, 2020]]) \n",
" \n",
"Week 3:\n",
"[Mon 13]([[January 13th, 2020]]) || [Tue 14]([[January 14th, 2020]]) || [Wed 15]([[January 15th, 2020]]) || [Thu 16]([[January 16th, 2020]]) || [Fri 17]([[January 17th, 2020]]) || [Sat 18]([[January 18th, 2020]]) || [Sun 19]([[January 19th, 2020]]) \n",
" \n",
"Week 4:\n",
"[Mon 20]([[January 20th, 2020]]) || [Tue 21]([[January 21st, 2020]]) || [Wed 22]([[January 22nd, 2020]]) || [Thu 23]([[January 23rd, 2020]]) || [Fri 24]([[January 24th, 2020]]) || [Sat 25]([[January 25th, 2020]]) || [Sun 26]([[January 26th, 2020]]) \n",
" \n",
"Week 5:\n",
"[Mon 27]([[January 27th, 2020]]) || [Tue 28]([[January 28th, 2020]]) || [Wed 29]([[January 29th, 2020]]) || [Thu 30]([[January 30th, 2020]]) || [Fri 31]([[January 31st, 2020]]) || [Sat 01]([[February 1st, 2020]]) || [Sun 02]([[February 2nd, 2020]]) \n",
" \n",
"Week 6:\n",
"[Mon 03]([[February 3rd, 2020]]) || [Tue 04]([[February 4th, 2020]]) || [Wed 05]([[February 5th, 2020]]) || [Thu 06]([[February 6th, 2020]]) || [Fri 07]([[February 7th, 2020]]) || [Sat 08]([[February 8th, 2020]]) || [Sun 09]([[February 9th, 2020]]) \n",
" \n",
"Week 7:\n",
"[Mon 10]([[February 10th, 2020]]) || [Tue 11]([[February 11th, 2020]]) || [Wed 12]([[February 12th, 2020]]) || [Thu 13]([[February 13th, 2020]]) || [Fri 14]([[February 14th, 2020]]) || [Sat 15]([[February 15th, 2020]]) || [Sun 16]([[February 16th, 2020]]) \n",
" \n",
"Week 8:\n",
"[Mon 17]([[February 17th, 2020]]) || [Tue 18]([[February 18th, 2020]]) || [Wed 19]([[February 19th, 2020]]) || [Thu 20]([[February 20th, 2020]]) || [Fri 21]([[February 21st, 2020]]) || [Sat 22]([[February 22nd, 2020]]) || [Sun 23]([[February 23rd, 2020]]) \n",
" \n",
"Week 9:\n",
"[Mon 24]([[February 24th, 2020]]) || [Tue 25]([[February 25th, 2020]]) || [Wed 26]([[February 26th, 2020]]) || [Thu 27]([[February 27th, 2020]]) || [Fri 28]([[February 28th, 2020]]) || [Sat 29]([[February 29th, 2020]]) || [Sun 01]([[March 1st, 2020]]) \n",
" \n",
"Week 10:\n",
"[Mon 02]([[March 2nd, 2020]]) || [Tue 03]([[March 3rd, 2020]]) || [Wed 04]([[March 4th, 2020]]) || [Thu 05]([[March 5th, 2020]]) || [Fri 06]([[March 6th, 2020]]) || [Sat 07]([[March 7th, 2020]]) || [Sun 08]([[March 8th, 2020]]) \n",
" \n",
"Week 11:\n",
"[Mon 09]([[March 9th, 2020]]) || [Tue 10]([[March 10th, 2020]]) || [Wed 11]([[March 11th, 2020]]) || [Thu 12]([[March 12th, 2020]]) || [Fri 13]([[March 13th, 2020]]) || [Sat 14]([[March 14th, 2020]]) || [Sun 15]([[March 15th, 2020]]) \n",
" \n",
"Week 12:\n",
"[Mon 16]([[March 16th, 2020]]) || [Tue 17]([[March 17th, 2020]]) || [Wed 18]([[March 18th, 2020]]) || [Thu 19]([[March 19th, 2020]]) || [Fri 20]([[March 20th, 2020]]) || [Sat 21]([[March 21st, 2020]]) || [Sun 22]([[March 22nd, 2020]]) \n",
" \n",
"Week 13:\n",
"[Mon 23]([[March 23rd, 2020]]) || [Tue 24]([[March 24th, 2020]]) || [Wed 25]([[March 25th, 2020]]) || [Thu 26]([[March 26th, 2020]]) || [Fri 27]([[March 27th, 2020]]) || [Sat 28]([[March 28th, 2020]]) || [Sun 29]([[March 29th, 2020]]) \n",
" \n",
" \n",
"-----------------\n",
"--- Quarter 2 ---\n",
"-----------------\n",
" \n",
"[W14]([[2020-W14]]) || [W15]([[2020-W15]]) || [W16]([[2020-W16]]) || [W17]([[2020-W17]]) || [W18]([[2020-W18]]) || [W19]([[2020-W19]]) || [W20]([[2020-W20]]) || [W21]([[2020-W21]]) || [W22]([[2020-W22]]) || [W23]([[2020-W23]]) || [W24]([[2020-W24]]) || [W25]([[2020-W25]]) \n",
" \n",
"Week 14:\n",
"[Mon 30]([[March 30th, 2020]]) || [Tue 31]([[March 31st, 2020]]) || [Wed 01]([[April 1st, 2020]]) || [Thu 02]([[April 2nd, 2020]]) || [Fri 03]([[April 3rd, 2020]]) || [Sat 04]([[April 4th, 2020]]) || [Sun 05]([[April 5th, 2020]]) \n",
" \n",
"Week 15:\n",
"[Mon 06]([[April 6th, 2020]]) || [Tue 07]([[April 7th, 2020]]) || [Wed 08]([[April 8th, 2020]]) || [Thu 09]([[April 9th, 2020]]) || [Fri 10]([[April 10th, 2020]]) || [Sat 11]([[April 11th, 2020]]) || [Sun 12]([[April 12th, 2020]]) \n",
" \n",
"Week 16:\n",
"[Mon 13]([[April 13th, 2020]]) || [Tue 14]([[April 14th, 2020]]) || [Wed 15]([[April 15th, 2020]]) || [Thu 16]([[April 16th, 2020]]) || [Fri 17]([[April 17th, 2020]]) || [Sat 18]([[April 18th, 2020]]) || [Sun 19]([[April 19th, 2020]]) \n",
" \n",
"Week 17:\n",
"[Mon 20]([[April 20th, 2020]]) || [Tue 21]([[April 21st, 2020]]) || [Wed 22]([[April 22nd, 2020]]) || [Thu 23]([[April 23rd, 2020]]) || [Fri 24]([[April 24th, 2020]]) || [Sat 25]([[April 25th, 2020]]) || [Sun 26]([[April 26th, 2020]]) \n",
" \n",
"Week 18:\n",
"[Mon 27]([[April 27th, 2020]]) || [Tue 28]([[April 28th, 2020]]) || [Wed 29]([[April 29th, 2020]]) || [Thu 30]([[April 30th, 2020]]) || [Fri 01]([[May 1st, 2020]]) || [Sat 02]([[May 2nd, 2020]]) || [Sun 03]([[May 3rd, 2020]]) \n",
" \n",
"Week 19:\n",
"[Mon 04]([[May 4th, 2020]]) || [Tue 05]([[May 5th, 2020]]) || [Wed 06]([[May 6th, 2020]]) || [Thu 07]([[May 7th, 2020]]) || [Fri 08]([[May 8th, 2020]]) || [Sat 09]([[May 9th, 2020]]) || [Sun 10]([[May 10th, 2020]]) \n",
" \n",
"Week 20:\n",
"[Mon 11]([[May 11th, 2020]]) || [Tue 12]([[May 12th, 2020]]) || [Wed 13]([[May 13th, 2020]]) || [Thu 14]([[May 14th, 2020]]) || [Fri 15]([[May 15th, 2020]]) || [Sat 16]([[May 16th, 2020]]) || [Sun 17]([[May 17th, 2020]]) \n",
" \n",
"Week 21:\n",
"[Mon 18]([[May 18th, 2020]]) || [Tue 19]([[May 19th, 2020]]) || [Wed 20]([[May 20th, 2020]]) || [Thu 21]([[May 21st, 2020]]) || [Fri 22]([[May 22nd, 2020]]) || [Sat 23]([[May 23rd, 2020]]) || [Sun 24]([[May 24th, 2020]]) \n",
" \n",
"Week 22:\n",
"[Mon 25]([[May 25th, 2020]]) || [Tue 26]([[May 26th, 2020]]) || [Wed 27]([[May 27th, 2020]]) || [Thu 28]([[May 28th, 2020]]) || [Fri 29]([[May 29th, 2020]]) || [Sat 30]([[May 30th, 2020]]) || [Sun 31]([[May 31st, 2020]]) \n",
" \n",
"Week 23:\n",
"[Mon 01]([[June 1st, 2020]]) || [Tue 02]([[June 2nd, 2020]]) || [Wed 03]([[June 3rd, 2020]]) || [Thu 04]([[June 4th, 2020]]) || [Fri 05]([[June 5th, 2020]]) || [Sat 06]([[June 6th, 2020]]) || [Sun 07]([[June 7th, 2020]]) \n",
" \n",
"Week 24:\n",
"[Mon 08]([[June 8th, 2020]]) || [Tue 09]([[June 9th, 2020]]) || [Wed 10]([[June 10th, 2020]]) || [Thu 11]([[June 11th, 2020]]) || [Fri 12]([[June 12th, 2020]]) || [Sat 13]([[June 13th, 2020]]) || [Sun 14]([[June 14th, 2020]]) \n",
" \n",
"Week 25:\n",
"[Mon 15]([[June 15th, 2020]]) || [Tue 16]([[June 16th, 2020]]) || [Wed 17]([[June 17th, 2020]]) || [Thu 18]([[June 18th, 2020]]) || [Fri 19]([[June 19th, 2020]]) || [Sat 20]([[June 20th, 2020]]) || [Sun 21]([[June 21st, 2020]]) \n",
" \n",
"Week 26:\n",
"[Mon 22]([[June 22nd, 2020]]) || [Tue 23]([[June 23rd, 2020]]) || [Wed 24]([[June 24th, 2020]]) || [Thu 25]([[June 25th, 2020]]) || [Fri 26]([[June 26th, 2020]]) || [Sat 27]([[June 27th, 2020]]) || [Sun 28]([[June 28th, 2020]]) \n",
" \n",
" \n",
"-----------------\n",
"--- Quarter 3 ---\n",
"-----------------\n",
" \n",
"[W27]([[2020-W27]]) || [W28]([[2020-W28]]) || [W29]([[2020-W29]]) || [W30]([[2020-W30]]) || [W31]([[2020-W31]]) || [W32]([[2020-W32]]) || [W33]([[2020-W33]]) || [W34]([[2020-W34]]) || [W35]([[2020-W35]]) || [W36]([[2020-W36]]) || [W37]([[2020-W37]]) || [W38]([[2020-W38]]) \n",
" \n",
"Week 27:\n",
"[Mon 29]([[June 29th, 2020]]) || [Tue 30]([[June 30th, 2020]]) || [Wed 01]([[July 1st, 2020]]) || [Thu 02]([[July 2nd, 2020]]) || [Fri 03]([[July 3rd, 2020]]) || [Sat 04]([[July 4th, 2020]]) || [Sun 05]([[July 5th, 2020]]) \n",
" \n",
"Week 28:\n",
"[Mon 06]([[July 6th, 2020]]) || [Tue 07]([[July 7th, 2020]]) || [Wed 08]([[July 8th, 2020]]) || [Thu 09]([[July 9th, 2020]]) || [Fri 10]([[July 10th, 2020]]) || [Sat 11]([[July 11th, 2020]]) || [Sun 12]([[July 12th, 2020]]) \n",
" \n",
"Week 29:\n",
"[Mon 13]([[July 13th, 2020]]) || [Tue 14]([[July 14th, 2020]]) || [Wed 15]([[July 15th, 2020]]) || [Thu 16]([[July 16th, 2020]]) || [Fri 17]([[July 17th, 2020]]) || [Sat 18]([[July 18th, 2020]]) || [Sun 19]([[July 19th, 2020]]) \n",
" \n",
"Week 30:\n",
"[Mon 20]([[July 20th, 2020]]) || [Tue 21]([[July 21st, 2020]]) || [Wed 22]([[July 22nd, 2020]]) || [Thu 23]([[July 23rd, 2020]]) || [Fri 24]([[July 24th, 2020]]) || [Sat 25]([[July 25th, 2020]]) || [Sun 26]([[July 26th, 2020]]) \n",
" \n",
"Week 31:\n",
"[Mon 27]([[July 27th, 2020]]) || [Tue 28]([[July 28th, 2020]]) || [Wed 29]([[July 29th, 2020]]) || [Thu 30]([[July 30th, 2020]]) || [Fri 31]([[July 31st, 2020]]) || [Sat 01]([[August 1st, 2020]]) || [Sun 02]([[August 2nd, 2020]]) \n",
" \n",
"Week 32:\n",
"[Mon 03]([[August 3rd, 2020]]) || [Tue 04]([[August 4th, 2020]]) || [Wed 05]([[August 5th, 2020]]) || [Thu 06]([[August 6th, 2020]]) || [Fri 07]([[August 7th, 2020]]) || [Sat 08]([[August 8th, 2020]]) || [Sun 09]([[August 9th, 2020]]) \n",
" \n",
"Week 33:\n",
"[Mon 10]([[August 10th, 2020]]) || [Tue 11]([[August 11th, 2020]]) || [Wed 12]([[August 12th, 2020]]) || [Thu 13]([[August 13th, 2020]]) || [Fri 14]([[August 14th, 2020]]) || [Sat 15]([[August 15th, 2020]]) || [Sun 16]([[August 16th, 2020]]) \n",
" \n",
"Week 34:\n",
"[Mon 17]([[August 17th, 2020]]) || [Tue 18]([[August 18th, 2020]]) || [Wed 19]([[August 19th, 2020]]) || [Thu 20]([[August 20th, 2020]]) || [Fri 21]([[August 21st, 2020]]) || [Sat 22]([[August 22nd, 2020]]) || [Sun 23]([[August 23rd, 2020]]) \n",
" \n",
"Week 35:\n",
"[Mon 24]([[August 24th, 2020]]) || [Tue 25]([[August 25th, 2020]]) || [Wed 26]([[August 26th, 2020]]) || [Thu 27]([[August 27th, 2020]]) || [Fri 28]([[August 28th, 2020]]) || [Sat 29]([[August 29th, 2020]]) || [Sun 30]([[August 30th, 2020]]) \n",
" \n",
"Week 36:\n",
"[Mon 31]([[August 31st, 2020]]) || [Tue 01]([[September 1st, 2020]]) || [Wed 02]([[September 2nd, 2020]]) || [Thu 03]([[September 3rd, 2020]]) || [Fri 04]([[September 4th, 2020]]) || [Sat 05]([[September 5th, 2020]]) || [Sun 06]([[September 6th, 2020]]) \n",
" \n",
"Week 37:\n",
"[Mon 07]([[September 7th, 2020]]) || [Tue 08]([[September 8th, 2020]]) || [Wed 09]([[September 9th, 2020]]) || [Thu 10]([[September 10th, 2020]]) || [Fri 11]([[September 11th, 2020]]) || [Sat 12]([[September 12th, 2020]]) || [Sun 13]([[September 13th, 2020]]) \n",
" \n",
"Week 38:\n",
"[Mon 14]([[September 14th, 2020]]) || [Tue 15]([[September 15th, 2020]]) || [Wed 16]([[September 16th, 2020]]) || [Thu 17]([[September 17th, 2020]]) || [Fri 18]([[September 18th, 2020]]) || [Sat 19]([[September 19th, 2020]]) || [Sun 20]([[September 20th, 2020]]) \n",
" \n",
"Week 39:\n",
"[Mon 21]([[September 21st, 2020]]) || [Tue 22]([[September 22nd, 2020]]) || [Wed 23]([[September 23rd, 2020]]) || [Thu 24]([[September 24th, 2020]]) || [Fri 25]([[September 25th, 2020]]) || [Sat 26]([[September 26th, 2020]]) || [Sun 27]([[September 27th, 2020]]) \n",
" \n",
" \n",
"-----------------\n",
"--- Quarter 4 ---\n",
"-----------------\n",
" \n",
"[W40]([[2020-W40]]) || [W41]([[2020-W41]]) || [W42]([[2020-W42]]) || [W43]([[2020-W43]]) || [W44]([[2020-W44]]) || [W45]([[2020-W45]]) || [W46]([[2020-W46]]) || [W47]([[2020-W47]]) || [W48]([[2020-W48]]) || [W49]([[2020-W49]]) || [W50]([[2020-W50]]) || [W51]([[2020-W51]]) \n",
" \n",
"Week 40:\n",
"[Mon 28]([[September 28th, 2020]]) || [Tue 29]([[September 29th, 2020]]) || [Wed 30]([[September 30th, 2020]]) || [Thu 01]([[October 1st, 2020]]) || [Fri 02]([[October 2nd, 2020]]) || [Sat 03]([[October 3rd, 2020]]) || [Sun 04]([[October 4th, 2020]]) \n",
" \n",
"Week 41:\n",
"[Mon 05]([[October 5th, 2020]]) || [Tue 06]([[October 6th, 2020]]) || [Wed 07]([[October 7th, 2020]]) || [Thu 08]([[October 8th, 2020]]) || [Fri 09]([[October 9th, 2020]]) || [Sat 10]([[October 10th, 2020]]) || [Sun 11]([[October 11th, 2020]]) \n",
" \n",
"Week 42:\n",
"[Mon 12]([[October 12th, 2020]]) || [Tue 13]([[October 13th, 2020]]) || [Wed 14]([[October 14th, 2020]]) || [Thu 15]([[October 15th, 2020]]) || [Fri 16]([[October 16th, 2020]]) || [Sat 17]([[October 17th, 2020]]) || [Sun 18]([[October 18th, 2020]]) \n",
" \n",
"Week 43:\n",
"[Mon 19]([[October 19th, 2020]]) || [Tue 20]([[October 20th, 2020]]) || [Wed 21]([[October 21st, 2020]]) || [Thu 22]([[October 22nd, 2020]]) || [Fri 23]([[October 23rd, 2020]]) || [Sat 24]([[October 24th, 2020]]) || [Sun 25]([[October 25th, 2020]]) \n",
" \n",
"Week 44:\n",
"[Mon 26]([[October 26th, 2020]]) || [Tue 27]([[October 27th, 2020]]) || [Wed 28]([[October 28th, 2020]]) || [Thu 29]([[October 29th, 2020]]) || [Fri 30]([[October 30th, 2020]]) || [Sat 31]([[October 31st, 2020]]) || [Sun 01]([[November 1st, 2020]]) \n",
" \n",
"Week 45:\n",
"[Mon 02]([[November 2nd, 2020]]) || [Tue 03]([[November 3rd, 2020]]) || [Wed 04]([[November 4th, 2020]]) || [Thu 05]([[November 5th, 2020]]) || [Fri 06]([[November 6th, 2020]]) || [Sat 07]([[November 7th, 2020]]) || [Sun 08]([[November 8th, 2020]]) \n",
" \n",
"Week 46:\n",
"[Mon 09]([[November 9th, 2020]]) || [Tue 10]([[November 10th, 2020]]) || [Wed 11]([[November 11th, 2020]]) || [Thu 12]([[November 12th, 2020]]) || [Fri 13]([[November 13th, 2020]]) || [Sat 14]([[November 14th, 2020]]) || [Sun 15]([[November 15th, 2020]]) \n",
" \n",
"Week 47:\n",
"[Mon 16]([[November 16th, 2020]]) || [Tue 17]([[November 17th, 2020]]) || [Wed 18]([[November 18th, 2020]]) || [Thu 19]([[November 19th, 2020]]) || [Fri 20]([[November 20th, 2020]]) || [Sat 21]([[November 21st, 2020]]) || [Sun 22]([[November 22nd, 2020]]) \n",
" \n",
"Week 48:\n",
"[Mon 23]([[November 23rd, 2020]]) || [Tue 24]([[November 24th, 2020]]) || [Wed 25]([[November 25th, 2020]]) || [Thu 26]([[November 26th, 2020]]) || [Fri 27]([[November 27th, 2020]]) || [Sat 28]([[November 28th, 2020]]) || [Sun 29]([[November 29th, 2020]]) \n",
" \n",
"Week 49:\n",
"[Mon 30]([[November 30th, 2020]]) || [Tue 01]([[December 1st, 2020]]) || [Wed 02]([[December 2nd, 2020]]) || [Thu 03]([[December 3rd, 2020]]) || [Fri 04]([[December 4th, 2020]]) || [Sat 05]([[December 5th, 2020]]) || [Sun 06]([[December 6th, 2020]]) \n",
" \n",
"Week 50:\n",
"[Mon 07]([[December 7th, 2020]]) || [Tue 08]([[December 8th, 2020]]) || [Wed 09]([[December 9th, 2020]]) || [Thu 10]([[December 10th, 2020]]) || [Fri 11]([[December 11th, 2020]]) || [Sat 12]([[December 12th, 2020]]) || [Sun 13]([[December 13th, 2020]]) \n",
" \n",
"Week 51:\n",
"[Mon 14]([[December 14th, 2020]]) || [Tue 15]([[December 15th, 2020]]) || [Wed 16]([[December 16th, 2020]]) || [Thu 17]([[December 17th, 2020]]) || [Fri 18]([[December 18th, 2020]]) || [Sat 19]([[December 19th, 2020]]) || [Sun 20]([[December 20th, 2020]]) \n",
" \n",
"Week 52:\n",
"[Mon 21]([[December 21st, 2020]]) || [Tue 22]([[December 22nd, 2020]]) || [Wed 23]([[December 23rd, 2020]]) || [Thu 24]([[December 24th, 2020]]) || [Fri 25]([[December 25th, 2020]]) || [Sat 26]([[December 26th, 2020]]) || [Sun 27]([[December 27th, 2020]]) \n",
" \n",
" \n"
],
"name": "stdout"
}
]
}
]
}
@MarkQueppet
Copy link

Hey, this is awesome. I don't really know python, but I love roam. I set up a jupyter notebook to try and figure a tweak but am getting stuck.

Instead of just having a week be like 2021-W12, I want my format to look something like this: 2021.w12 - 03.21 - 03.27 and show the range of dates, as week numbers aren't something that my brain knows exactly how to process.

How would I modify this script to get the first and last day of the week added to it?

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