Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mabasic/wakatime-php-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.4
Choose a base ref
...
head repository: mabasic/wakatime-php-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 21, 2018

  1. Fix.

    mabasic committed Oct 21, 2018
    Copy the full SHA
    0239aa4 View commit details

Commits on Oct 1, 2019

  1. Copy the full SHA
    335d158 View commit details
Showing with 26 additions and 5 deletions.
  1. +3 −0 .github/FUNDING.yml
  2. +1 −1 LICENSE.md
  3. +21 −3 README.md
  4. +1 −1 src/Traits/Reports.php
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: laravelista
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Mario Basic
Copyright (c) 2014-2019 Mario Basic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# WakaTime PHP API

[![Build Status](https://travis-ci.org/mabasic/wakatime-php-api.svg)](https://travis-ci.org/mabasic/wakatime-php-api) [![Latest Stable Version](https://poser.pugx.org/mabasic/wakatime-php-api/v/stable.svg)](https://packagist.org/packages/mabasic/wakatime-php-api) [![Total Downloads](https://poser.pugx.org/mabasic/wakatime-php-api/downloads.svg)](https://packagist.org/packages/mabasic/wakatime-php-api) [![Latest Unstable Version](https://poser.pugx.org/mabasic/wakatime-php-api/v/unstable.svg)](https://packagist.org/packages/mabasic/wakatime-php-api) [![License](https://poser.pugx.org/mabasic/wakatime-php-api/license.svg)](https://packagist.org/packages/mabasic/wakatime-php-api)
WakaTime API for PHP

**WakaTime API for PHP**
[![Become a Patron](https://img.shields.io/badge/Become%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista)

## Overview

This is a PHP package for WakaTime API. It supports resource endpoints from [WakaTime API](https://wakatime.com/developers) with additional helper methods for hours logged.

If you are using [Laravel](http://laravel.com/) check out [WakaTime Reports and Laravel](http://laravelista.com/posts/wakatime-reports-and-laravel/).
~~If you are using [Laravel](http://laravel.com/) check out [WakaTime Reports and Laravel](http://laravelista.com/posts/wakatime-reports-and-laravel/)~~.

If you find that some resource endpoints are missing feel free to send me a PR. *(Be sure to include tests for your code)*

@@ -171,3 +173,19 @@ Copy `.env.example` file to `.env` and set your api key and project name before
```
vendor/bin/phpunit
```

## Laravelista Sponsors & Backers

I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Laravelista [Backers page](https://laravelista.hr/backers).

## Contributing

Thank you for considering contributing to WakaTime PHP API! The contribution guide can be found on the [Laravelista website](https://laravelista.hr/contributing).

## Code of Conduct

In order to ensure that the Laravelista community is welcoming to all, please review and abide by the [Code of Conduct](https://laravelista.hr/code-of-conduct).

## License

WakaTime PHP API is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).
2 changes: 1 addition & 1 deletion src/Traits/Reports.php
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ public function getHoursLoggedFor($startDate, $endDate, $project = null, $branch
public function getHoursLoggedForLast($period, $project = null, $branches = null)
{
$endDate = date('m/d/Y');
$startDate = date_format(date_sub(date_create($todayDate), date_interval_create_from_date_string($period)), 'm/d/Y');
$startDate = date_format(date_sub(date_create($endDate), date_interval_create_from_date_string($period)), 'm/d/Y');

return $this->getHoursLoggedFor($startDate, $endDate, $project, $branches);
}