javascript - JSON Call JS Display Date formatting -


Using JSON, I was able to successfully display the file with the loop path and date through a directory

However, I'm not sure how to change the output. I just want to show months and years instead of day-to-month year. $ GetJSON ( "http://www.houston.org/api/v1/forms/dir", function (data) {DatakforEach (function (o, i) {Adiand ( '& lt; div & gt; & lt ; a href = " '+ o.phath +' / '+ n.Name +'" & gt; '+ new date (o. Created) .toDateString () +' & Lt; / a & gt; & lt; / div> ';);});}); & Lt; Div id = "arChives" & gt; & Lt; / Div & gt;

View my sample

In addition to this question (if I do not want to ask this question separately, then it is definite), to capture the date I created the file wish or last modified date as I add new docs / dir / folder, so the date is finally attached to each file propounded the same ... even if you clear the last modified date January K

Itemprop = "text">

You formatted the date You can use:

  moment (date (create.)). Format ('DD / MM / YYYY')   



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -