What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-22 09:45:03
export array in javascript
// Exporting individual features export let name1, name2, …, nameN; // also var, const export let name1 = …, name2 = …, …, nameN; // also var, const export function functionName(){...} export class ClassName {...} // Export li... Add solution -
Javascript 2021-09-11 00:46:02
angular implementing Validator
<>Copyimport {AbstractControl, ValidatorFn} from '@angular/forms'; export function blue(): ValidatorFn { return (control: AbstractControl): { [key: string]: any } | null => control.value?.toLowerCase() === 'blue' ? n... Add solution -
Javascript 2021-09-07 20:11:02
change text size according to screen react native
import { Dimensions, Platform, PixelRatio } from 'react-native'; const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT, } = Dimensions.get('window'); // based on iphone 5s's scale const scale = SCREEN_WIDTH / 320 ; export ... Add solution -
Other 2021-09-07 05:34:02
does not conform to the required format. The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
export function toDatetimeLocal(){ const date = new Date(), ten = (i)=> ((i < 10 ? '0' : '') + i ), YYYY = date.getFullYear(), MTH = ten(date.getMonth() + 1), DAY = ten(date.getDate()), HH = ten(date.getHours()), MM... Add solution -
Javascript 2021-09-04 07:36:02
typescript/JavaScript time ago from datetime
/** * A function that converts date object to human readable time ago * @param {Date} date * @returns {string} * @author [YogPanjarale](https://github.com/YogPanjarale) */ export function dateToTimeAgo(date: Date): string { const now = new Date(Dat... Add solution
Best helpers
Ranking is empty