Forum Replies Created by sibche2013

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: Just wanna share using Laravel and Canvas JS #24757

    I don’t know how can i use in my code ,
    this is my code in my controller :
    public function viewArchives(){
    $data = Archive::select(‘created_at’)->get();
    return view(‘view.archives’, compact(‘data’));
    }
    and in view :
    <?php echo $data;?>
    the result is :
    {“created_at”:”2019-03-17 19:10:30″}
    but i want the result be like this :
    {“created_at”:”1552849830″}

    how can i do this?
    thanks

    • This reply was modified 5 years, 7 months ago by sibche2013.
    in reply to: Just wanna share using Laravel and Canvas JS #24748

    when i use
    dataPoints: <?php echo $data; ?>
    that shows to me like this :
    dataPoints:[{“x”:2019-03-17 17:48:05,”y”:100}]
    but i want to show like this for showing on chart:
    dataPoints:[{“x”:1483381800000,”y”:100}]}]
    i can’t see chart by this format :
    dataPoints:[{“x”:2019-03-17 17:48:05,”y”:100}]

    in reply to: Just wanna share using Laravel and Canvas JS #24745

    hello
    i want to use created_at column on my chart as X , but it needs to be in unixtimestamp format , how can i get or convert date from database from date like this 2019-03-17 17:48:05 to 1553720114 format?
    thanks

Viewing 3 posts - 1 through 3 (of 3 total)