Skip to content
Snippets Groups Projects
Commit c4b9bd04 authored by Paco Guzman's avatar Paco Guzman
Browse files

API support for the 'since' and 'until' operators on commit requests

- Parameter validation as ISO8601 format
parent a792427e
Branches
Tags
Loading
Loading
  • Sir,

    Can you show me a way to get commits from a particular day. I have tried many time. I don't know actual syntax

    curl -H "PRIVATE-TOKEN: <TOKEN>" "http://code.redpanthers.co/api/v3/projects/187/repository/commits?ref_name=dev&since='2016-05-18T09:36:12.163Z'"
    
    curl -H "PRIVATE-TOKEN: <TOKEN>" "http://code.redpanthers.co/api/v3/projects/187/repository/commits?ref_name=dev&since=2016-05-17T09:36:12.163Z"
    

    \Javascript

    var getBranchCommit = HTTP.get(url,{
              headers:{
                "PRIVATE-TOKEN":getGitLabUser.gitlab
              },
              params:{
                ref_name: branch.name,
                since: moment(currentDate).format() 
    
              }
            });

    also tried moment().toISOString()

    Edited by username-removed-540554
  • Paco Guzman @pacoguzman ·
    Contributor

    Hi Sibin,

    Could you try with something like?

    curl -H "PRIVATE-TOKEN: " "http://code.redpanthers.co/api/v3/projects/187/repository/commits?ref_name=dev&since=2016-05-17T00:00:00Z&until=2016-05-18T00:00:00Z"

    So you should get the commits for the 2016-05-17 day.

    Are you getting some specific response to your API requests? Like bad requests parameters or something like that. I think the single quotes that quote your since value parameter are not right and probably the milliseconds that you're adding needs to be removed (just to try to find out the problem)

  • username-removed-444214 @MrChrisW

    mentioned in issue #20364 (moved)

    ·

    mentioned in issue #20364 (moved)

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment