PageSourceSearch

https://static.fd.nl/assets/6.32.1/js/DigikrantCalendar.8778.d7da85b4f41377bb19f5.chunk.js

js fd.nl collected 2026-09-24 08:27:37 UTC 4,319 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfdmg_gui=self.webpackChunkfdmg_gui||[]).push([[8778],{92:function(t,e,n){n.r(e),n.d(e,{DigikrantCalendar:function(){return s}});var a=n(2745);const r=[{long:"januari"},{long:"februari"},{long:"maart"},{long:"april"},{long:"mei"},{long:"juni"},{long:"juli"},{long:"augustus"},{long:"september"},{long:"oktober"},{long:"november"},{long:"december"}];class s extends a.x{dataConfig(){return["context","month","year","day"]}defaultConfig(){return{context:"/",editions:{}}}constructor(t,e){super(t,e);const n=new Date(this.config.year,this.config.month-1);n.setHours(6,0,0,0),this.render(n)}handleDate(t){const e=new Date(t.target.getAttribute("data-new-date"));e.setHours(6,0,0,0),this.render(e)}handleDay(t){location.href=t.target.getAttribute("data-url")}render(t){this.el.innerHTML=this.renderHeader(t)+this.renderMonth(t);const e=this.el.querySelectorAll(".calendar-month, .calendar-year");for(let t=0;t<e.length;t++)e[t].addEventListener("click",(t=>this.handleDate(t)));const n=this.el.querySelectorAll("[data-url]");for(let t=0;t<n.length;t++)n[t].addEventListener("click",(t=>this.handleDay(t)))}getNewDate(t,e){const n=Object.keys(this.config.editions).sort((function(t,e){return+new Date(e)-+new Date(t)})),a=[];for(let t=0;t<n.length;t++){const e=new Date(n[t]);e.setHours(6,0,0,0),a.push(e)}a.sort((function(e,n){return Math.abs(t-e)-Math.abs(t-n)}));const r=a.filter((function(e){return e-t<=0})),s=a.filter((function(e){return e-t>=0}));return-1===e&&r[0]?new Date(r[0]):1===e&&s[0]?new Date(s[0]):""}renderHeader(t){const e=new Date(t);e.setMonth(e.getMonth()-1),e.setHours(6,0,0,0);const n=new Date(t);n.setMonth(n.getMonth()+1),n.setHours(6,0,0,0);const a=new Date(t);a.setFullYear(a.getFullYear()+1),a.setHours(6,0,0,0);const s=new Date(t);s.setFullYear(s.getFullYear()-1),s.setHours(6,0,0,0);let o='<button class="calendar-end"></button>',l='<button class="calendar-end"></button>',d='<button class="calendar-end"></button>';const c=Object.keys(this.config.editions),i=new Date(c[c.length-1]).setHours(6,0,0,0),h=new Date(c[0]);let u;this.getNewDate(e,-1)&&this.getNewDate(e,-1)!==h&&(l=`<button class="calendar-month calendar-previous" data-new-date="${this.getNewDate(e,-1)}"></button>`),this.getNewDate(n,1)&&(o=`<button class="calendar-month calendar-next" data-new-date="${this.getNewDate(n,1)}"></button>`),this.getNewDate(s,-1)&&this.getNewDate(s,-1)!==h&&(d=`<button class="calendar-year calendar-previous" data-new-date="${this.getNewDate(s,-1)}"></button>`),u=this.getNewDate(a,1)?`<button class="calendar-year calendar-next" data-new-date="${this.getNewDate(a,1)}"></button>`:`<button class="calendar-year ${new Date(i).setHours(6,0,0,0)===new Date(t).setHours(6,0,0,0)?"equal-to-latest calendar-end":"skip-to-latest"} calendar-next" data-new-date="${new Date(i)}"></button>`;const g=r[t.getMonth()].long,D=t.getFullYear(),w='<div class="calendar-year-header">'.concat(d,'<span class="calendar-title calendar-year-title">'+D+"</span>",u,"</div>"),b='<div class="calendar-month-header">'.concat(l,'<span class="calendar-title calendar-month-title">'+g+"</span>",o,"</div>");return'<div class="calendar-header">'.concat(w,b,"</div>")}renderMonth(t){const e=[],n=t.getMonth();for(;t.getMonth()===n;)e.push(this.renderWeek(t));return'<table class="calendar-days">'.concat('<thead><tr><th title="zondag">Z</th><th title="maandag">M</th><th title="dinsdag">D</th><th title="woensdag">W</th><th title="donderdag">D</th><th title="vrijdag">V</th><th title="zaterdag">Z</th></tr></thead>',"<tbody>",e.join(""),"</tbody></table>")}renderWeek(t){let e;const n=[];let a=0;const r=t.getMonth();for(;a<7;)t.getDay()===a&&t.getMonth()===r?(e=this.renderDay(t,this.isCurrent(t)?"current":""),t.setDate(t.getDate()+1)):e="<td></td>",n.push(e),a++;return"<tr>".concat(n.join(""),"</tr>")}static getKey(t){return t.getFullYear()+"-"+("0"+(t.getMonth()+1)).slice(-2)}renderDay(t,e){let n;return this.config.editions[s.getKey(t)].indexOf(t.getDate())>-1?(n=[this.config.context,t.getFullYear(),t.getMonth()+1,t.getDate()].join("/"),'<td data-url="'+n+'" class="calendar-day has-publication '+e+'">'+t.getDate()+"</td>"):'<td class="calendar-day">'+t.getDate()+"</td>"}isCurrent(t){const e=this.config;return t.getDate()==e.day&&t.getMonth()+1==e.month&&t.getFullYear()==e.year}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.