Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

split date in javascript

var date = "28st December,2016";

var date_split1 = date.split(' ');
var date_split2 = date_split1[1].split(',');

console.log('date: ', date_split1[0]);
console.log('month: ', date_split2[0]);
console.log('year: ', date_split2[1]);
Comment

PREVIOUS NEXT
Code Example
Javascript :: joi schema for confirm password 
Javascript :: javascript base64 encode file input 
Javascript :: javascript check if two keys are pressed 
Javascript :: ajax get form data 
Javascript :: react hooks delete item from array 
Javascript :: jquery download image from url 
Javascript :: how to find the index of a value in an array in javascript 
Javascript :: seconds to degrees 
Javascript :: javascript filter unique 
Javascript :: flatten in js without lodash 
Javascript :: javascript is a string numeric 
Javascript :: javascript window.history.pushstate 
Javascript :: string methods javascript count number of words inside a string 
Javascript :: roblox headshot image js 
Javascript :: chart js x axis start at 0 
Javascript :: js window active 
Javascript :: refresh current component angular 
Javascript :: object values javascript 
Javascript :: jquery get all checkbox checked 
Javascript :: javascript redirect to route laravel 
Javascript :: destructure dynamic properties 
Javascript :: search class regex 
Javascript :: how to fetch the all input element id value 
Javascript :: js is numeric 
Javascript :: slicknav cdn 
Javascript :: regex match everything except 
Javascript :: js maximum number value 
Javascript :: vue max characters html input 
Javascript :: putting a loop into an array javascript 
Javascript :: TypeError: (0 , T.useState) is not a function 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =