# \[APP\]\[PRO\] Date Condition

**URL:** <https://community.homey.app/t/app-pro-date-condition/100502>\
**Category:** Apps\
**Tags:** app, homey-pro\
**Created:** [January 8, 2024, 8:05pm UTC](https://community.homey.app/t/app-pro-date-condition/100502 "2024-01-08T20:05:30Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [January 2, 2026, 7:11pm UTC](https://community.homey.app/t/app-pro-date-condition/100502/21 "2026-01-02T19:11:35Z")

</div>

![IMG_2048](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/9/39b0aef977e8f35e4fe301b10ceb3d4cc4ede381.jpeg)  
Is this what you want?  
 ![Scherm­afbeelding 2026-01-02 om 20.24.22](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/7/d7e8bc1cb9963e993b5ef6b0e5ee5e1e029c446e.png)

In advanced flows you can combine X-mas and newyears-eve like this

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [January 2, 2026, 7:21pm UTC](https://community.homey.app/t/app-pro-date-condition/100502/22 "2026-01-02T19:21:19Z")

</div>

I love the community - thank you for helping out!

---

<div class="post-metadata">

**Author:** ![RayCokes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/raycokes/32/12452_2.png) [@RayCokes](https://community.homey.app/u/RayCokes)\
**Post date:** [January 2, 2026, 9:09pm UTC](https://community.homey.app/t/app-pro-date-condition/100502/23 "2026-01-02T21:09:28Z")

</div>

@Wim_Post love it, thanks, I missed it again. 🤣🤦🏻‍♂️👍Thanks

---

<div class="post-metadata">

**Author:** ![RayCokes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/raycokes/32/12452_2.png) [@RayCokes](https://community.homey.app/u/RayCokes)\
**Post date:** [January 2, 2026, 9:10pm UTC](https://community.homey.app/t/app-pro-date-condition/100502/24 "2026-01-02T21:10:05Z")

</div>

Great to see and happy new year for everyone 🎇🥂👍👍

---

<div class="post-metadata">

**Author:** ![Eric\_Jilot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eric_jilot/32/81619_2.png) [@Eric\_Jilot](https://community.homey.app/u/Eric_Jilot)\
**Post date:** [October 4, 2026, 3:55pm UTC](https://community.homey.app/t/app-pro-date-condition/100502/25 "2026-10-04T15:55:08Z")

</div>

First, I’d like to thank you for the app and the time you have put into it for the community.

Second, I have some JavaScripts that I think I can convert into flow cards.

```auto
// weekday constants for readability
const MON = 1;
const TUE = 2;
const WED = 3;
const THU = 4;
const FRI = 5;
const SAT = 6;
const SUN = 0;

// Nth weekday of a month (e.g., 3rd Monday)
function nthWeekday(year, month, weekday, n) {
  const first = new Date(year, month - 1, 1);
  const firstWeekday = first.getDay();
  const offset = (weekday - firstWeekday + 7) % 7;
  const day = 1 + offset + (n - 1) * 7;
  return new Date(year, month - 1, day);
}

// Last weekday of a month (e.g., last Monday)
function lastWeekday(year, month, weekday) {
  const last = new Date(year, month, 0); // last day of month
  const lastWeekday = last.getDay();
  const offset = (lastWeekday - weekday + 7) % 7;
  return new Date(year, month - 1, last.getDate() - offset);
}

// Main APS holiday resolver
function getApsHolidays(year) {
  return {
    "New Year's Day": new Date(year, 0, 1),

    "Martin Luther King Day": nthWeekday(year, 1, MON, 3), // 3rd Monday
    "Presidents Day": nthWeekday(year, 2, MON, 3), // 3rd Monday

    "Cesar Chavez Day": new Date(year, 2, 31), // Mar 31

    "Memorial Day": lastWeekday(year, 5, MON), // Last Monday in May

    "Juneteenth": new Date(year, 5, 19), // Jun 19
    "Independence Day": new Date(year, 6, 4), // Jul 4

    "Labor Day": nthWeekday(year, 9, MON, 1), // 1st Monday in September

    "Indigenous Peoples' Day": nthWeekday(year, 10, MON, 2), // 2nd Monday in October

    "Veterans Day": new Date(year, 10, 11), // Nov 11

    "Thanksgiving": nthWeekday(year, 11, THU, 4), // 4th Thursday in November

    "Christmas Eve": new Date(year, 11, 24),
    "Christmas Day": new Date(year, 11, 25),

    "New Year's Eve": new Date(year, 11, 31)
  };
}

```

Hopefully you can make use of them for your next release.

[Previous page](https://community.homey.app/t/app-pro-date-condition/100502.md?page=1)
