javascript convert any date to more readable form — November 20, 2017

javascript convert any date to more readable form

we can use javascript DATE function. Here converting ISO date to dd/mm/yyyy

var date = new Date('2017-11-17T00:00:00+00:00');		console.log(date.toLocaleDateString('en-GB'));

Using (en-GB) to gove it format of (dd/mm/yyyy). You can check more locale options here.

Advertisements
javascript Select JSON object with a colon in the key — November 14, 2017
jQuery check and make sure that function exists — November 13, 2017
Css align text Vertically Center — October 31, 2017

Css align text Vertically Center

To align text vertically centered we need to add some table properties to div. First we need a outer div which must have a fixed height. Then a middle div and in that middle div we can add any text. We just need these properties.

.outer { display: table;position: static;height: 222px; }
.middle {display: table-cell;vertical-align: middle;width: 100%;position: static;}

For better explanation please follow this link. There is one more example with css FLEX property.

convert ColdFusion variables into JavaScript variables — October 30, 2017
Javascript decode string which has special Chars or Html entities — October 26, 2017
Ubuntu move content to parent directory — October 3, 2017