title: How can I check if a date is older then 10 days from today?
body: <p>Im trying to see if a date is beyond different intervals, and if so add some stylesheet to them. Im using <code>Vuejs</code> version 3 for this. I have not been able to locate the issue, but the result vary. For example if <code>user.active.created_at</code> is the same date as <code>dayjs()</code>, it does return <code>fill-gray-400</code> and not <code>fill-green-400</code>. <code>user.active.created_at</code> is the last sign-in date for user.</p>
  <p>This is my method:</p>
  <pre><code>  methods: {
      active(user){
        var isBetween = require('dayjs/plugin/isBetween')
        dayjs.extend(isBetween)
        
        if(dayjs(user.active.created_at).isBetween(dayjs().subtract(10, 'day'), dayjs(), 'day')){
          return 'fill-green-400'
        }
  
        if(dayjs(user.active.created_at).isBetween(dayjs().subtract(30, 'day'), dayjs(), 'day')){
          return 'fill-red-400'
        }
  
        return 'fill-gray-400'
        
      }
    },
  </code></pre>
  <p>And this is my template that im trying to add classes to</p>
  <pre><code>&lt;div v-for=&quot;user in users&quot;&gt;
      &lt;icon name=&quot;chart-simple&quot; class=&quot;flex-shrink-0 ml-2 w-3 h-3&quot; :class=&quot;active(user)&quot; /&gt;
  &lt;/div&gt;
  </code></pre>
  <p>The expected result is if a user has signed-in in the last 10 days, return <code>fill-green-400</code> and if a user has signed-in in the past 30 days, return <code>fill-red-400</code>.</p>