67 Posts
Mario Adrian
10 years ago
Topic

Hello

is there anyway i can create a list of article of content type that is created on specific time? [yesterday, this week, this month]

i tried to to fill the default value with date() but it's not working

any suggestion?

Get a Book for SEBLOD
10 years ago
6
Level 1

Hi Mario! In List & Search Type in the Search Tab you can set up at the Button [3] in the Match Column Past or Future. 

1) Create two hidden calendar fields for example "Date from" and "Date to";

2) For "date to" set the standard value to "now" and at #3 in the Match column "Past"

3) For "date from" you can set the default value to regular expression like "-1 day" or "-1 week" or "-1 month" and at #3 in the Match column "Future"

3) If you need the user to select the specific range you can create a simple select field and define the values for last week, last month, last day to "-1 day" "-1 week" and "-1 month" and pass the value to the "Date from" field.

3) Set both of the date formats according to the format in the field "Article created" and show time to "no" the storage should be: standard->article->created

3) You can set the Date from and Date to fields to hidden.

I hope i could explain it understandable.

Rgds.

Elisa

67 Posts
Mario Adrian
10 years ago
4
Level 2

Hello

i couldnt really understand your explanation? would you mind giving me some screenshot of it working?

also i only need to filter out data that is between [a day/a week/a month/custom range like 10 day before today] to now/today

10 years ago
3
Level 3

Yes, of course. In attachment i give you an example for 1 week in the past. (Edit: sorry there is a mistake in the screen for hidden fields, of course you don´t hide the search button but the Date from field :-) )

67 Posts
Mario Adrian
10 years ago
1
Level 4

Hello i found alternative way using the article created

Set the default value to -1 day

set the match with any words [which means it filters it as a string]

worked fine

anyway thanks for your info

10 years ago
0
Level 5

Where is the like button for your solution, thanks also! :-)

But does it also show up the articles within a range of 1 week/month/... and on?

118 Posts
webchun
6 years ago
0
Level 4

Hi, Elisa thanks for the explanation. It helps alot. Anyway, how can I make the search is applied on first load? Its working only when clicking the submit button. I have enabled 'Search on first load' option on the menu item's settings. Thanks!

9 Posts
schekutiev
8 years ago
0
Level 2

designbengelthank you very much for the detailed description!

175 Posts
webcastor
10 years ago
1
Level 1

Dear Mario,

Elisa's solution is the right one. Your solution gives the impression of working, but is not correct on many levels. What I meant is that your solution is sort of asking for trouble, since dates have their own logic when treated as strings.

67 Posts
Mario Adrian
10 years ago
0
Level 2

Hi

i will look into it. I'm just wondering if there is more simple way to get it since my method only invalid if i need to "show any article created yesterday" , anything that ranges from dates to today/current date can be done using my method [set it to future and add in -1 week / - 1 month on default] [cant be used on specific X dates to Y Dates too though]

tl;dr

if you need something along with X days/ X month/ X Week to Now/Today,you can use my method 

if you need specific X dates to Y dates, you need to use Elisa's method

1283 Posts
Bucklash
7 years ago
6
Level 1

Ho

Old post, I know, but keeps it all together as this is one of the best ones...

I am having trouble making one fo the calendar fields disabled.

The input itself gets disabled, but the form still submits any data present in the field.

---

If I have Elisa's two calendar fields, one set for future and one for past, how do you only have one enabled at a time?

Conditionals are not really doing it for me.

Is a position variation required?

I have select field with Today=now and Before today=-1 day.

So using conditionals, the relevant calendar field is filled by correct value ie I now and the other calendar field should be disabled.

My search field does get disabled, but the search still applies both calendar fields.

Also, it seems the calendar fields need a default value or a live value for the conditionals to work

1283 Posts
Bucklash
7 years ago
4
Level 3

Hi CC-C

I did 'empty' and things like that already.

I want to filter articles scheduled before or after today's date.

The select offers user before and after choice.

calendar field one is Match for before and calendar field 2 is match for after.

I will try filling with different value...

7 years ago
3
Level 4

Yes maybe try to fill field one with 01.01.1900 if you select before, and field two with 31.12.2100 if you select after :)

1283 Posts
Bucklash
7 years ago
2
Level 5

Will do  :)

Thanks 

6 years ago
1
Level 6

Did you get it working? :-)

1283 Posts
Bucklash
6 years ago
0
Level 7

Nah haha. it beat me:)

Get a Book for SEBLOD