Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rachelle 1 post 71 karma points
    Sep 29, 2016 @ 00:57
    Rachelle
    0

    How to display views of today?

    To display the views for the last 7 days is this: @CounterService.GetValue(post.Id, 7)

    How about the views today, should I make the 7 to 1? Thank you

  • Cimplex 113 posts 576 karma points
    Sep 29, 2016 @ 18:59
    Cimplex
    0

    Hi Rachelle,

    If you want the views for the last 24 hours you'll use this:

    @CounterService.GetValue(post.Id, 1)
    

    If you want the views for a specific day you'll use:

    @CounterService.GetValueBetween(post.Id, DateTime.Parse("2016-09-29 00:00"), DateTime.Parse("2016-09-29 23:59"))
    

    // Herman

Please Sign in or register to post replies

Write your reply to:

Draft