Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
How to get the date of last commit of repo?

Example JSON:

[
  {
    "sha": "0bf21a1dc1c03f11bb44ac32a65c17b5857b020c",
    "node_id": "MDyODE2MY6Q29tbWl0NzYGJmMjFjYzE3YjUwM2YxMDk6MWJiNDRhYzMyYTFkYzFhNjU4NTdiMDIwYw==",
    "commit": {
      "author": {
        "name": "Max Mustermann",
        "email": "max@mustermann.at",
        "date": "2016-12-12T19:56:46Z"
      },
      "committer": {
        "name": "GitHub",
        "email": "noreply@github.com",
        "date": "2016-12-12T19:56:46Z"
      },
      "message": "Update README.md", ...

How do I get the date of commit -> author -> date in javascript?
My test:

fetch("https://api.github.com/repos/schletz/3KanalAdWandler/commits", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result.commit.author.date))
  .catch(error => console.log('error', error));

What I get: TypeError: Cannot read properties of undefined (reading 'author')

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

resultappears to be an array, so you'll have to include the array index. console.log(result[0].commit.author.date).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!