My Code Docs

My Code Docs

  • Docs
  • Projects
  • Components
  • Help

›JS/React Libs

Javascript

  • Promises and Asnyc/Await
  • Local Storage
  • Firebase
  • JS Language Basics
  • JS Array Functions
  • Keyboard and Mouse Input
  • ES6 Cheatsheet
  • ESLint Setup
  • Data Structures
  • Naming Conventions
  • Javascript Resources
  • Javascript Snippets
  • npm Module Creation

Node

  • Node JS Basics
  • Server Config and SSH

NextJS

  • NextJS Basics

JS/React Libs

  • Lodash Library
  • Axios
  • Ramda
  • Moment JS
  • Overmind
  • Redux Forms npm Module
  • React Beautiful DnD
  • Ant Design
  • Zustand State Managment

React

  • React Basics
  • React Hooks
  • React With Classes
  • Reach Router
  • React Router
  • React Components

Redux

  • Redux in React
  • My Redux Pattern
  • Redux with React (First Doc)
  • Simple Redux Package

ReactNative

  • React Native
  • React Navigation V5
  • React Navigation V4

HTMLCSS

  • HTML and CSS Snippets
  • Tailwind CSS

Electron

  • Electron React Boiler
  • Electron Basics
  • Electron Packaging
  • Electron Tooling

Moment JS

Moment Docs

Basic Usage:

import moment from 'moment';

//just calling moment creates a moment object that you can do stuff with
const now = moment();

//Format a moment object
const prettyDate = now.format('MMM Do, YYYY')

//If you want to store a date/time in the database, get the valueOf(), which is unix timestamp
const unixTimestamp = now.valueOf()

//Converting a unixTimestamp back to a moment object.
const aMoment = moment(unixTimeStamp)

Formatting Date Options

Compare Dates

Use the Query methods to compare dates.

Moment Query Methods

← RamdaOvermind →
  • Compare Dates
My Code Docs
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2020 McCoidCo