//@LibraryID:164,2 //@Name:First Price Date //@Description:Returns the date of the first price of a security in the format YYYY/MM/DD. This means you can sort the column correctly. //@Returns:Text //@Width:60 // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. function getVal(share) { var data=share.getPriceArray(); if (data==null || data.length<1) return; var dateYear = dateNumGetYear(data[0].dateNum); var dateMonth = 1+dateNumGetMonth(data[0].dateNum); var dateDay = 1+dateNumGetDay(data[0].dateNum); return dateYear+"/"+(dateMonth<10?"0"+dateMonth:dateMonth)+"/"+(dateDay<10?"0"+dateDay:dateDay); }