Skip to content

Instantly share code, notes, and snippets.

View thelnwaon's full-sized avatar
😎

Aon Chpch thelnwaon

😎
View GitHub Profile
gid:yHhb8U7gKenDYL8r9ouTxW
@thelnwaon
thelnwaon / date.js
Created September 26, 2019 06:50
Get timestamp before 7 days
/** get date before 7 days */
var date = new Date()
date.setDate(date.getDate() - 7)
let getDateBefore7Days = date.getTime() / 1000 // set timestamp before 7 day
### Keybase proof
I hereby claim:
* I am thelnwaon on github.
* I am thelnwaon (https://keybase.io/thelnwaon) on keybase.
* I have a public key ASDU5u8hoWMXPRdclpwWlUp9fYaTrf6NrnkDm_N8-M0drQo
To claim this, I am signing this object:
var arrayOfObjects = [
{
name: 'Diana',
born: 1373925600000, // Mon, Jul 15 2013
num: 4,
sex: 'female'
},
{
getDifferenceDate (dataDate, selectedDate) {
let date1 = new Date(dataDate)
let date2 = new Date(selectedDate)
let diffDays = date2.getDate() - date1.getDate()
return diffDays
}
calculateDifferenceDays (a, b) {
const _MS_PER_DAY = 1000 * 60 * 60 * 24
@thelnwaon
thelnwaon / keybase.md
Created April 28, 2018 13:31
keybase

Keybase proof

I hereby claim:

  • I am thelnwaon on github.
  • I am thelnwaon (https://keybase.io/thelnwaon) on keybase.
  • I have a public key ASAfYBg9ZtwZ0TNmZGWe4Bfv7oGo6mUrfia48I7XWLctggo

To claim this, I am signing this object: