Skip to content

Category: Questions

Compare date and time in array of objects

I’m trying to compare the date and time to manipulate my data. I need to check which is the latest data by checking updated_at key inside object. Below I have given the scenario. I’m trying like this, but how to use moment here to compare which is latest. But I’m not getting the expected res…

ChartJS show value in legend (Chart.js V3.5)

I need the value of chart show after name of data for example ([colour of data] Car 50, [colour of data] Motorcycle 200). I’ve tried change the value of legend title but it doesn’t work at all Here is it my code: Answer You can use a custom generateLabels function for this:

Regex – Replace quote in quotes

The following regex pattern finds the a single double quote in the following string examples (basically the double quote after the 1). The problem is that the positive lookbehind is not supported in some browsers. Is there an alternative regex pattern that would work? I need to replace this double quote with …

OpenId Connect, Query Microsoft Graph

We have a .Net Web Application that uses Single Sign On implemented by OpenID Connect to create an ID token and log a user in. Specifically Microsoft.Owin.Security.OpenIdConnect and Microsoft.IdentityModel.Protocols.OpenIdConnect I now have a requirement to query Microsoft Graph API via JavaScript. In order f…