hackforla / website

Hack for LA's website
https://www.hackforla.org
GNU General Public License v2.0
315 stars 754 forks source link

Remove unused variable to resolve CodeQL Alert issue #114 #7295

Closed pluto-bell closed 3 weeks ago

pluto-bell commented 3 weeks ago

Overview

To remove an unused variable, thus cleaning up the code to make it more readable.

Action Items

The resolution of this issue will close #7013 and resolve alert 114

Update getDayString function from

function getDayString(date) {
    let new_date = new Date(date); 
    let weekday = new_date.getDay();
    let options = { weekday: "long" };
    return new Intl.DateTimeFormat("en-US", options).format(new_date);
  }

to

function getDayString(date) {
    let new_date = new Date(date); 
    let options = { weekday: "long" };
    return new Intl.DateTimeFormat("en-US", options).format(new_date);
  }

Resources/Instructions

For further information you can review issue #7013

Note: this exact function is also found in api-events.js, without the weekday variable.

api-events.js — line 119
Screenshot 2024-08-15 at 11 36 05 AM
HackforLABot commented 3 weeks ago

Hi @pluto-bell, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

pluto-bell commented 3 weeks ago

Misunderstood issue #7013's instructions so I am closing this issue, as it is technically a duplicate of it.