React-Big-Calendar and Timezones
Cutter's Crossing
by
4y ago
I spend a lot of time with React, these days, converting a rather large AngularJs application from the inside out. Our app deals extensively with date/time, and has to be able to do so within the context of changing timezones. We chose to use React-Big-Calendar because it checked off all the boxes: configurability, skinnable, flexible, customizable. Need an 'event' to look different based on it's data? No problem. Need external view state control? No problem. But the one thing it doesn't do, out of the box, is handle timezones. It's not that it can't, it's just that the authors of the compon ..read more
Visit website
JS Tip: Simple Array Of Unique Items
Cutter's Crossing
by
5y ago
A co-worker showed me a simple trick for getting an array of unique, simple values. Let's say we were combining two arrays of message id's: let arr = [19,22,7,12,6,85]; let arr2 = [22,8,3,19,45]; let newArr = [...arr, ...arr2]; // newArr equals [19, 22, 7, 12, 6, 85, 22, 8, 3, 19, 45] This gives us a new array, combining the values of the first two. But, we often only want the unique values. Rather than looping over every item, checking for dupes, etc, we can take advantage of the new Set object. A `Set` lets you store unique values of any type, and automatically tosses duplicates. As an i ..read more
Visit website
Fun With Destructuring
Cutter's Crossing
by
5y ago
If you aren't compiling your JavaScript (well, EcmaScript...) code with Babel, you're probably missing out on some of the best features of the evolving language. On the other hand, if you're working in React or Angular every day, you've probably come across some of the most dynamic features. Destructuring is a prime example, but it's also important to understand the "gotchas". Let's take a simple example to show you some of the power of destructuring. const nodes = [{ id: '0-1', label: 'Led Zeppelin', members: [{ id: '0-1-1', label: 'Jimmy Paige' }, { id: '0-1-2', label: 'Robert ..read more
Visit website

Follow Cutter's Crossing on FeedSpot

Continue with Google
Continue with Apple
OR