ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

In EE can you set properties based on a date

September 03, 2013 9:25pm

Subscribe [4]
  • #1 / Sep 03, 2013 9:25pm

    shawnblc

    17 posts

    In EE can you set properties based on a date?

    Let me explain what I’m looking for.  If the expiration date is 9/01/2013, 7 days prior I’d like it to turn yellow.  1 day after I’d like it to turn red.  Meaning that action is required, in most cases it will be a file upload or a form needs filled out.  Can EE do this?

     

  • #2 / Sep 04, 2013 4:11am

    Bhashkar Yadav

    727 posts

    Hi Shawnblc,

    If I am understanding correctly, you would like to change the entry status color before specified time (7 days, 1 day). Right?

    There isn’t any such feature in EE. There is an addon Auto Expire which is a little like your need but not fulfill you need.

    I think, it would be better to develop a custom extension which will update the status color for entries which are about to expire after 7 days or 1 day while admin logs in Control Panel.

    Share your kind thought on this approach. There can be another approach by scheduling this process via CRON.

  • #3 / Sep 04, 2013 8:24am

    shawnblc

    17 posts

    For instance you have

    Particular report:  whatever

    Today’s date:  09042013

    Next Due Date 09302013 this cell is currently green

    on 09232013 this cell would turn yellow

    on 10012013 it would turn red

  • #4 / Sep 04, 2013 9:15am

    Bhashkar Yadav

    727 posts

    In which area you would like to have such a feature?

  • #5 / Sep 04, 2013 9:39am

    shawnblc

    17 posts

    In which area you would like to have such a feature?

    Thank you for the response.  I’m just getting my feet wet with EE, but this would pertain to file uploads (reports in PDF format) and for forms that need submitted online.  Each would have date that they need filled out or submitted by date. 

    Last Date     Due
    9-01-2013   9-30-2013   (on 9-23-2013 this would turn yellow then red on 10-01-2013 if not submitted or uploaded)

     

     

  • #6 / Sep 05, 2013 7:53pm

    shawnblc

    17 posts

    Bhashkar,  After being able to play with EE over the last day or two, the ideal place would be to have it in the categories.  Perhaps a field that where you can select daily, bi-weekly, monthly, 42 days, 60 days, quarterly, and annually.  You’d need a “last date” too, so you’d have a starting point.  You’d get a green if you’re good, yellow that it’s within 7 days of being due, and a red with it’s past due.

    Hope you understand.

  • #7 / Sep 06, 2013 3:52pm

    Chriiiiso

    46 posts

    Are you wanting to actually tag it somehow, or just need to change the color?

    You could do a simple conditional CSS.  Not gonna spend time on coding it for you, but logic like this would be simple.

    Have a field in your entries, let’s call it DUEDATE.

    If DUEDATE-CURRENTDATE > 7, apply style GREEN
    If DUEDATE-CURRENTDATE < 8 AND >0, apply style YELLOW
    If DUEDATE-CURRENTDATE <= 0, apply style RED.

    Not the best example, but maybe something to get you thinking about that method.

    http://ellislab.com/expressionengine/user-guide/templates/date_variable_formatting.html to get a usable number, maybe {current_time format="%m%d%y"} so it’d output a simple 090613.

    and advanced conditionals http://ellislab.com/expressionengine/user-guide/templates/globals/conditionals.html#else-and-elseif

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases