This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsQR from 'jsqr' // required package | |
import Jimp from 'jimp' // required package | |
const BASE64_MARKER = ';base64,' | |
const base64ToArrayBuffer = (dataURI) => { | |
const base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length | |
const base64 = dataURI.substring(base64Index) | |
const binaryString = window.atob(base64) | |
const len = binaryString.length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import styled from 'styled-components' | |
const { datesGenerator } = require('dates-generator'); | |
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] | |
const Container = styled.div` | |
width: 300px; | |
border: 1px solid black; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const daysInMonth = (iYear, iMonth) => 32 - new Date(iYear, iMonth, 32).getDate() | |
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
const getSelectedMonthDates = (selectedYear, selectedMonth) => { | |
const calendarDates = [] | |
const firstDay = (new Date(selectedYear, selectedMonth)).getDay() // 0 = 'Sunday', 6 = 'Saturday' | |
const days = daysInMonth(selectedYear, selectedMonth) // how many days in a month | |
let x = 0 |