Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Working with Canadian benefit payment dates in JavaScript

If you build a budgeting app or a reminder bot for people in Canada, someone will ask: "When does my CPP come in?" It looks like a date-math problem. Mostly it isn't. Here is how we handle it at Daybook Times, and where code should stop guessing. Start from the official list The source of truth is the Benefits payment dates calendar on canada.ca . It lists the 2026 and 2027 dates for programs run…

When creating a budgeting app or reminder bot for Canadians, the question often arises: "When do my CPP payments come in?" The answer is not a simple calculation but rather a matter of looking up official dates. The primary source for these dates is the Benefits payment dates calendar on canada.ca, which lists the payments for 2026 and 2027 programs run by Service Canada and the CRA.

It also notes that payments are issued on those dates but can take a few days to arrive, and that cheques by mail take longer than direct deposit. People should wait 5 to 10 business days before contacting the program if they have concerns.

At Daybook Times, we handle these dates by storing the published list rather than computing anything for CPP and OAS. This way, we can return the next payment date when given a specific date. For CPP and OAS, the dates are stored as strings in the format YYYY-MM-DD. The function nextPayment takes a list and a date, and returns the next date from the list that is on or after the given date.

If no date is found, it returns null, indicating that the current year's data has been exhausted and the next year's list should be used.

There are two programs with simple rules that can be coded: CPP and OAS. These programs can be used to check data, but they should not replace the official list. For the Canada Disability Benefit (CDB), we use a function that calculates the third Thursday of the month. For the Canada Child Benefit (CCB), we estimate the date to be around the 20th of the month.

However, if the 20th falls on a weekend, the payment is moved to the preceding Friday. We also have a list of CCB dates for 2026 and compare it to a function that estimates the dates. We found one mismatch for December 11, 2026, which is an exception due to a holiday. In such cases, the official date should be used and any discrepancies should be checked with the user and the paying agency.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Approved, but Locked Outside My Own House 🐝🔑

Sorry for my absence 😅 I was busy finishing something: a WordPress plugin for BeeLadybug, written in PHP. Just a small first piece, but mine. 🐞 Here's how it went.

  • WordPress plugin BeeLadybug approved by WordPress.org
  • Antonio Prosperi's account blocked after plugin submission
  • BeeLadybug inspects WordPress sites for layout issues

iPhone Face ID Not Working? 7 Fixes That Work

Face ID suddenly stops unlocking your iPhone, or it fails every time and asks for your passcode instead. This is often caused by a dirty camera, a screen protector covering the sensor, a change in…

  • Clean TrueDepth camera area with soft cloth to remove obstructions
  • Ensure Face ID is enabled in Settings Face ID & Passcode
  • Update iOS to latest version for potential Face ID fixes

Play random sound variations in Godot 4

The same footstep, hit or coin sound playing over and over starts to sound mechanical. You recorded several takes. Here is how to make Godot 4 pick between them.

  • AudioStreamRandomizer resource allows multiple sound variations in Godot 4
  • Playback modes include random with no repeats, random, or sequential
  • Cue Banks for Godot 4 tool simplifies creating and managing sound banks

Amazon Interview Question: Count the Votes. Now Let Everyone Change Their Mind.

One voter, two browser tabs, and the follow ups that turn a simple counter into a system design problem. Maya votes for A, changes her mind, and votes for B. Her connection drops, so her phone sends…

  • Design a live poll system for millions of concurrent voters.
  • Implement versioned records for each voter's choice to handle changes.
  • Use transactional datastores and stable request IDs to manage updates.

More from Tuesday, 1 December 2026 →