Get date from store and compare to todays date
<p>I have a store in sencha, in the store I have 2 date fields, start_date and end_date, I want to get this data from my store, and compare it to the current day, then if the end_date from the store matches todays date, I need to output an ext.toast message, that shows the respective data. This is based on licenses and their start and end dates.</p>

<p>I just need to know how I would set this up, ultimately I want it in the launch function, so it launches on first startup</p>

<p>this is my store</p>

<pre><code>    Ext.define('ClientInfo.store.LicenseAllStore', {
    extend: 'Ext.data.Store',

    requires: [
        'ClientInfo.model.LicenseAllModel',
        'Ext.data.proxy.Ajax',
        'Ext.data.reader.Json'
    ],

    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            storeId: 'LicenseAllStore',
            autoLoad: true,
            model: 'ClientInfo.model.LicenseAllModel',
            proxy: {
                type: 'ajax',
                extraParams: {
                    class: 'LicenseAll',
                    method: 'get'
                },
                url: 'system/index.php',
                reader: {
                    type: 'json',
                    rootProperty: 'topics'
                }
            }
        }, cfg)]);
    }
});
</code></pre>

<p>and this is my model</p>

<pre><code>    Ext.define('ClientInfo.model.LicenseAllModel', {
    extend: 'Ext.data.Model',

    requires: [
        'Ext.data.field.Field'
    ],

    fields: [
        {
            name: 'license_id'
        },
        {
            name: 'license_number'
        },
        {
            name: 'start_date'
        },
        {
            name: 'end_date'
        },
        {
            name: 'duration'
        },
        {
            name: 'expiry_date'
        },
        {
            name: 'product_id'
        },
        {
            name: 'product_name'
        },
        {
            name: 'version'
        },
        {
            name: 'company_id'
        },
        {
            name: 'name'
        },
        {
            name: 'physical_address'
        },
        {
            name: 'postal_address'
        },
        {
            name: 'people_id'
        },
        {
            name: 'firstname'
        },
        {
            name: 'lastname'
        },
        {
            name: 'occupation'
        },
        {
            name: 'office_number'
        },
        {
            name: 'cell_number'
        },
        {
            name: 'email'
        },
        {
            name: 'harware_id'
        },
        {
            name: 'server_url'
        },
        {
            name: 'ip_address'
        },
        {
            name: 'mac_address'
        },
        {
            name: 'os_id'
        },
        {
            name: 'os_name'
        },
        {
            name: 'os_version'
        },
        {
            name: 'os_build'
        }
    ]
});
</code></pre>

<p>So far I have this in the launch function</p>

<pre><code>var start = Ext.getCmp('overviewGrid').store.data.start_date;
var end = Ext.getCmp('overviewGrid').store.data.end_date;
var today = new Date();
if(end.setHours(0,0,0,0) == today.setHours(0,0,0,0));
{
   Ext.toast({
    html: 'Expiring Licenses',
    title: 'Licenses',
    width: 200,
    align: 't',
    autoClose: false
});
}
</code></pre>