Skip to content

Author: admin@master

Make google chart responsive

Im using google charts in a project but im having a hard time to make them responsive. Iǘe seen other examples on responsive charts but I cant seem to get it to work in my case. All my charts gets rendered and after that their sizes do not change. If someone can make this chart responsive id appreciate it. Th…

Typescript – Conditional require

One of the problems of moment-timezone is that it gives you a warning if you include it multiple times. I have a module that requires the timezone. Because I don’t know if whoever is using will or will not set the timezone themself, I have the following: This works fine in normal Javascript. I recently …

Match and replace a substring while ignoring special characters

I am currently looking for a way to turn matching text into a bold html line. I have it partially working except for special characters giving me problems because I desire to maintain the original string, but not compare the original string. Example: Given the original string: And wanting to match: To get the…

Get integer number in interval with JavaScript

I want to know which is the best method to get the integer/whole number in interval with native JavaScript function? for example if I have [1.3, 2.5] ==> given result: 2 Answer You could use the integer value from the left value and the ceiled value from the right value and get the integer value from the m…