Skip to content

Commit

Permalink
Display an additional 6 years of parsha in List of Dates
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 6, 2024
1 parent 813c00a commit a79a63c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
12 changes: 8 additions & 4 deletions src/sedrot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import dayjs from 'dayjs';

const VEZOT_HABERAKHAH = 'Vezot Haberakhah';

const YEARS_PRE = 3;
const YEARS_TOTAL = 24;

const options15yr = {
year: new Date().getFullYear() - 2,
numYears: 18,
year: new HDate().getFullYear() - YEARS_PRE,
isHebrewYear: true,
numYears: YEARS_TOTAL,
noHolidays: true,
sedrot: true,
};
Expand All @@ -35,9 +39,9 @@ function simchatTorahDate(hyear, il) {
}

function makeVezotEvents(il) {
const startYear = new HDate().getFullYear() - 2;
const startYear = new HDate().getFullYear() - YEARS_PRE;
const events = [];
for (let i = 0; i < 18; i++) {
for (let i = 0; i < YEARS_TOTAL; i++) {
const hyear = startYear + i;
const hd = simchatTorahDate(hyear, il);
const pe = new ParshaEvent(hd, [VEZOT_HABERAKHAH], il);
Expand Down
12 changes: 7 additions & 5 deletions views/parsha-detail.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,19 @@ Some congregations read the entire parsha every year (“Option A”).</div>
<% } // books %>
</div><!-- .d-print-none -->
<% if (items.length) { -%>
<div class="row mb-2">
<div class="col">
<h4 id="dates">List of Dates</h4>
Parashat <%=parshaName%> is read in <%=locationName%> on:
</div><!-- .col -->
</div><!-- .row -->
<div class="row mb-3">
<% for (let i = 0; i < 3; i++) { -%>
<div class="col-md">
<ul class="list-unstyled mb-0">
<% for (let i = 0; i < items.length; i += 6) { -%>
<div class="col">
<ul class="list-unstyled">
<% for (let j = 0; j < 6; j++) { -%>
<% const item = items[(i * 6) + j]; if (item) { -%>
<% const item = items[i + j]; if (item) { -%>
<li class="text-nowrap"><%=item.event.getDate().getFullYear()%> <span class="text-body-secondary">·</span> <a href="<%=item.anchor%>-<%=item.d.format('YYYYMMDD')%><%=iSuffix%>"><time datetime="<%=item.d.format('YYYY-MM-DD')%>"><%=item.d.format('D MMM YYYY')%></time></a>
<% if (item.desc !== parsha.name) { %> · <small><%=item.desc%></small><% } %>
<% } -%>
Expand All @@ -252,6 +253,7 @@ Parashat <%=parshaName%> is read in <%=locationName%> on:
</div><!-- .col -->
<% } -%>
</div><!-- .row -->
<% } // items.length -%>
<div class="row d-print-none">
<div class="col">
<form method="GET" action="/sedrot/<%=parsha.anchor%>">
Expand All @@ -273,7 +275,7 @@ Parashat <%=parshaName%> is read in <%=locationName%> on:
<h4 id="ref">References</h4>
<dl>
<% if (typeof summary === 'object') { %>
<dt><a href="<%- summary.link %>">Parashat <%=parshaName%> from Sefaria.org</a>
<dt><a href="<%- summary.link %>">Parashat <%=parsha.p1||parshaName%> from Sefaria.org</a>
<dd>Sefaria, Inc.
<% } %>
<% if (commentary['asin']) { %>
Expand Down

0 comments on commit a79a63c

Please sign in to comment.