Completed
Push — master ( 01907b...5981e6 )
by mehdi
03:03
created

test.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
use OpenCafe\Datium as Datium;
3
use OpenCafe\Tools\Convert as Covnert;
4
try{
5
require_once( 'vendor/autoload.php' );
6
var_dump( "-----------------------[ Test Start ]-------------------------<br/>" );
7
// echo '<br>this year:<br>';
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
8
// var_dump( Datium::create( 2016, 1, 25, 12, 0, 0 )->to( 'hijri' )->lang( 'ar' )->get('l jS F Y h:i:s A'), "\n\r" );
9
// var_dump( Datium::now()->to( 'jalali' )->get('l jS F Y h:i:s A'), "\n\r"  );
10
// echo "Create new DateTime: ";
11
// var_dump( Datium::create(2000, 1, 1, 0, 0, 0)->get(), "\n\r"  );
12
// echo 'Is next year leap? ';
13
// var_dump( Datium::now()->add('1 year')->leap()->get(), "\n\r"  );
14
echo "Day of Year in gregorian:";
15
var_dump( Datium::now()->dayOf()->year() , "<br/>" );
16
// echo "Day of Year in jalali:";
17
// var_dump( Datium::now()->to('jalali')->dayOf()->year(), "\n\r"  );
18
// echo "Day of Year in hijri:";
19
// var_dump( Datium::now()->to( 'hijri' )->dayOf()->year(), "\n\r"  );
20
// echo "Day of Week : gregorian";
21
// var_dump( Datium::now()->dayOf()->week(), "\n\r"  );
22
// echo "Day of Week in Date(2015, 1, 1)";
23
// var_dump( Datium::create( 2015, 1, 1 )->dayOf()->week(), "\n\r"  );
24
// echo "Day of Week : jalali";
25
// var_dump( Datium::now()->to('jalali')->dayOf()->week(), "\n\r"  );
26
// echo "Day of Week in Date(2015, 1, 1)";
27
// var_dump( Datium::create( 2015, 1, 1 )->to('jalali')->dayOf()->week(), "\n\r"  );
28
// echo "Change date form gregorian to jalali with method: ";
29
// var_dump( Datium::create( 1989, 10, 27 )->to( 'jalali' )->get( 'l jS F Y h:i:s A' ), "\n\r"  );
30
// var_dump( Datium::now()->to( 'hijri' )->get( 'l jS F Y h:i:s A' ), "\n\r"  );
31
// var_dump( Datium::now()->to( 'hijri' )->lang( 'ar' )->get( 'h:i:s Y jS l F' ), "\n\r"  );
32
// echo "is persian holiday? ";
33
// var_dump(  Datium::between( Datium::now()->object() , Datium::now()->add( '3 month' )->object() )->events()->local( 'us' )->local( 'ir' )->get() );
34
// echo 'return international days';
35
// var_dump(  Datium::between( Datium::now()->object() , Datium::now()->add('4 month')->object() )->events()->international()->get() );
36
// echo 'Convert gregorian to perisan';
37
// echo 'Today\'s events:';
38
// var_dump( Datium::now()->events()->local( 'ir' )->get() );
39
// echo 'Persian calendar:';
40
// var_dump( Datium::now()->lang('fa')->get( 'l jS F Y h:i:s A' ) );
41
var_dump( "-----------------------[ Test End ]-------------------------<br/>" );
42
} catch (Exception $e ) {
43
  var_dump( $e );
44
}
45