Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5daae5d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanAyaz committed Apr 9, 2024
1 parent af01a73 commit 462590e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<link rel="stylesheet" href="styles.ef46db3751d8e999.css"></head>
<body>
<ycd-root></ycd-root>
<script src="runtime.bccf84395eb43a19.js" type="module"></script><script src="polyfills.c26f7546d6cf4dc2.js" type="module"></script><script src="main.d28a8cf62dd16562.js" type="module"></script>
<script src="runtime.bccf84395eb43a19.js" type="module"></script><script src="polyfills.c26f7546d6cf4dc2.js" type="module"></script><script src="main.89416031e5c061e2.js" type="module"></script>

</body></html>

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/search/search_index.js

Large diffs are not rendered by default.

38 changes: 24 additions & 14 deletions pipes/WeekNumberPipe.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="146"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:146</a></div>
<div class="io-line">Defined in <a href="" data-line="156"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:156</a></div>
</td>
</tr>

Expand Down Expand Up @@ -180,8 +180,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="157"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:157</a></div>
<div class="io-line">Defined in <a href="" data-line="167"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:167</a></div>
</td>
</tr>

Expand Down Expand Up @@ -263,8 +263,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="150"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:150</a></div>
<div class="io-line">Defined in <a href="" data-line="160"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:160</a></div>
</td>
</tr>

Expand Down Expand Up @@ -344,8 +344,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="172"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:172</a></div>
<div class="io-line">Defined in <a href="" data-line="182"
class="link-to-prism">projects/angular-year-calendar/src/lib/pipes/week-number/week-number.pipe.ts:182</a></div>
</td>
</tr>

Expand Down Expand Up @@ -515,7 +515,14 @@ <h3 id="methods">
const dateClone &#x3D; new Date(date);
const millisecondsInADay &#x3D; 86400000;

const { firstWeekMonth, weekStartsOn, forceWeek, forceWeekDate } &#x3D; ycConfig;
const {
firstWeekMonth,
weekStartsOn,
forceWeek,
forceWeekDate,
periodWeekNumber,
} &#x3D; ycConfig;

let result;
if (
firstWeekMonth &#x3D;&#x3D;&#x3D; undefined ||
Expand Down Expand Up @@ -560,8 +567,8 @@ <h3 id="methods">
firstWeekFirstDate &#x3D; subDays(firstWeekFirstDate, customDateDay);
} else {
firstWeekFirstDate &#x3D; addWeeks(firstWeekFirstDate, firstWeekMonth.week);
firstWeekFirstDate.setHours(12, 0, 0, 0);
}
firstWeekFirstDate.setHours(12, 0, 0, 0);
dateDay &#x3D; this.getDayInView(dateClone, weekStartsOn);
currentWeekStartDate &#x3D; subDays(dateClone, dateDay);

Expand Down Expand Up @@ -606,10 +613,12 @@ <h3 id="methods">
}
}

if (ycConfig.periodWeekNumber) {
date.setHours(12, 0, 0, 0);
if (periodWeekNumber) {
// if forceWeek then use currentWeekStartDate instead of provided date
const currentYearStartDiff &#x3D;
(date.getTime() - firstWeekFirstDate.getTime()) / millisecondsInADay;
((forceWeek ? currentWeekStartDate : dateClone).getTime() -
firstWeekFirstDate.getTime()) /
millisecondsInADay;

// calculating period week number from range [1-4] using the week number calculated above
let week &#x3D; result &#x3D;&#x3D;&#x3D; 53 ? 1 : result;
Expand All @@ -623,7 +632,8 @@ <h3 id="methods">
const weekNumber &#x3D; week % 4 || 4;

const nextYearStartDiff &#x3D;
(nextYearFirstDate.getTime() - date.getTime()) / millisecondsInADay;
(nextYearFirstDate.getTime() - dateClone.getTime()) /
millisecondsInADay;

// calculation for the &quot;Adjustment Week&quot; if days remaining are in multiple of 7
if (nextYearStartDiff % 7 &#x3D;&#x3D;&#x3D; 0 &amp;&amp; nextYearStartDiff &lt;&#x3D; 35) {
Expand Down

0 comments on commit 462590e

Please sign in to comment.