Jump to content

Search the Community

Showing results for tags 'date'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Lister Native Date Format Allows the date format for "created", "modified" and "published" columns to be set within a Lister or Lister Pro instance. Why? Lister formats the "created", "modified" and "published" columns as relative time strings and doesn't provide an easy way to change this without writing code. Sometimes a value like "3 weeks ago" is not precise enough and you want to see an exact date/time in these columns, perhaps only temporarily before switching back to a relative date. Details An icon is added near the top right of the Lister that reveals a dropdown where you can select from a list date formats that you define in the module config. The Lister will remember your chosen date format the next time you visit the Lister. If you have Lister Pro installed then each Lister Pro instance will remember the date format previously set for that instance. Configuration In the "Date options" field in the module config, enter a list of date formats that are compatible with wireDate(), one format per line. The default date format used by Lister is "rel". You can also set a default date format for native fields which will apply to all Listers that haven't yet had a date format chosen from the dropdown. https://github.com/Toutouwai/ListerNativeDateFormat https://processwire.com/modules/lister-native-date-format/
  2. Hi. I want select pages where now between date and end_date or now bigger than date and end_date is empty. I have five tried variants: $start = strtotime(date('Y-m-d') . " 00:00:00"); $results = $page->children("foo=(date<$start,date_end=''),bar=(date<$start,date_end>=$start),sort=-date,limit=12"); $start = strtotime(date('Y-m-d') . " 00:00:00"); $results = $page->children("date<$start,(date_end='',date_end>=$start),sort=-date,limit=12"); $start = strtotime(date('Y-m-d') . " 00:00:00"); $results = $page->children("date_end=''|date_end>=$start,date<$start,sort=-date,limit=12"); $start = strtotime(date('Y-m-d') . " 00:00:00"); $results = $page->children("!date_end|date_end>=$start,date<$start,sort=-date,limit=12"); $start = strtotime(date('Y-m-d') . " 00:00:00"); $results = $page->children("date_end>=$start|!date_end,date<$start,sort=-date,limit=12"); All this variants not worked for me and returned zero results.
  3. Hello everyone. I have a question that i can't find a way to solve. I have following function in _uikit.php $date = $page->get('date|createdStr'); $dateModified = $page->get('datemodified'); But I need to output the $date in to different formats. My further function looks like this // return the blog post article markup return " <div> <article class='uk-article blog-post $class'> <meta property='name' content='$page->title'> <meta property='author' typeof='Person' content='Arra Lifte Harmanschlag'> <meta property='dateModified' content='$dateModified'> <meta property='datePublished' content='$date'> <meta class='uk-margin-remove-adjacent' property='articleSection' content='News'> <div property='image' typeof='ImageObject'> $featuredBlogPostImage </div> $heading <ul class='mt25 uk-margin-remove-bottom uk-subnav uk-subnav-divider'> <li class='uk-article-meta'> <time datetime='$date'>$byline</time> </li> </ul> <div class='mt25' property='text'> $body </div> </article> </div> "; Now I need to output the meta property in this format 2019-03-02CET05:23:00 and then a normal date format that is displayed on the Homepage with 2. März 2019 without time. Can anybody help me? Thanks in advance.
  4. I am trying to get the strftime format from the function convertDateFormat(). However, the output has $ signs in it which i cannot use in strftime.(example of conversion : $d/$m/%Y what strftime actually uses: %d/%m/%Y). Am I in the wrong here or is there some way to format strftime? Thank you in advance :).
  5. Hi, I'm creating a multilingual blog for a client. I'm using Multi-language fields, and it's working great. Essentially, there are two versions of each article: one in English and one in Spanish. Now, I've created a Datetime field with a "Date/time picker" so that they can add a publication date (no time) to their blog entries. I want the month part of the date to be displayed in whatever language the article is being displayed in. Let's take the following example: 1) "Un artículo de ejemplo", accessible via example.com/un-articulo-de-ejemplo/ 2) "A sample article", accessible via example.com/en/a-sample-article/ In this example, for article number 1 I want the date to be "12 ene 2017", and for article number 2 I want it to be "12 jan 2017". In other words, the same format for both languages, but localised. And for some reason, I seem unable to do so and dates are always displayed in English. Here's the code I'm using to display the date field: <?= $post->publication_date; ?> How can I get this to work? Thanks.
  6. When echoing a date field directly from the $user variable echo $user->date; the timestamp is printed. Using echo $users->get($user->id)->date; prints the correct formated value. Is this a bug or or intended?
  7. Hello all. I am trying to find a way to have a query with all pages that were published on a specific date (today for example). I read a few posts where people had a specific date field and were limitting the results by that, however is there a way to filter results without a specific date field? As far as I am able to publish the timestamp using $page->created logically I should be able to filter by the result of it? What is the best way to accomplish a filter for a day, week, month etc.?
  8. I am currently running the Processwire 3.x branch (specifically 3.0.36 at the moment) and am back-porting data from a previous website that was created back in 2010. In trying to provide seemingly accurate publication dates to the older articles that I'm manually porting, I was thinking of adding a `published` field to the pages. Upon closer inspection I found that all pages do indeed have a `published` field already (in this version of ProcessWire anyhow). I suspect it was added to core back when ProDrafts was created. I see that there's a module to handle the ability of providing this field to all pages. http://modules.processwire.com/modules/publish-date/ I'm not sure if this is necessary now though if all pages already have an associated `published` date field? Would a module need to be created to expose this database field to the admin side, or is there another way to do this? Would modifying this field cause any detrimental side-effects (I do own a ProDrafts dev license, though am not currently using it in this project).
  9. Is there any built in way of disregarding the time on output in a datetime field is the time was orginially set? Ive gone from using the date only to using both date and time, but any timeless pages default to outputing 12:00am which looks odd having many pages listed in this way. Any thoughts would be welcome
  10. Hi, Can't for the life of me work out this puzzle: I have a date field being rendered on a site, when I'm logged in I get this format echoed: Friday, 8 July 2016, but when im logged out I get this timestamp: 1467932400 Anyone found this before?
  11. Hi, I'm having a sorting problem that I need to solve. I have the following code: $today = time(); $trainings = $pages->get('/formacao/')->find("template=training, limit=6, !training_start<$today, sort=training_start"); It's working fine, except for one little problem: I need to show the trainings that have training_start filled first and then the one's that don't. This solution shows the empty ones first! Is there any way to do this with a simple selector? Or do I have to find twice? To understand better: Result that I have now: Footbal: Date not set yet! Ragueby: Date no set yet! Volleyball: 1-Apr-2016 Handball: 5-Apr-2016 Running: 10-Apr-2016 Jumping: 15-Apr-2016 Result needed: Volleyball: 1-Apr-2016 Handball: 5-Apr-2016 Running: 10-Apr-2016 Jumping: 15-Apr-2016 Footbal: Date not set yet! Ragueby: Date no set yet!
  12. Hi, i want to set a date field value by api but i have problems to do so. I think this should be work: $page->of(false); $page->expire_date = time(); $page->save(); $page->of(true); but when i look into the field i get not the saved time. The output is always: 30 Nov, -0001 00:00 (timestamp: -62169987208). when i echo the time directly after the $page->of(true); than i get the current time but avter reload and output the time bevor $page->of(false); i get the time above! do you have any idea whats the problem?
  13. Hi there, I have a little problem with a repeater that I'm using for events, containing three fields: start_date, end_date, description On the homepage, I want to display the upcoming two events. So I have to filter out past events, sort by the dagte and set a limit for the output I thought I could do it with something like the following code, but there's no output: $nextevents = $pages->get("template=events")->events->find("end_date>today, sort=end_date, limit=2"); foreach($events as $event) : ?> <li class="future-event"><?= $event->end_date ?><span><?= $event->description ?></span></li> <?php endforeach ?> the template of the repeater is called "events" and the repeater field's name is also "events" I guess it can't be that difficult, but after trying different things and looking through the docs, I still have no idea how to solve it. Would be great if someone can help! Thanks
  14. Hello One year working with PW and no need to ask for help, but today have something funny going on in my date time field. When i input a year in the PW backend link 1867-01-01 it will be saved to the mysql database, when i reload the page, the field doesn't show up in the PW backend. When i try to output also no luck. When i enter the year 1902-01-01 no problems for display in the front and backend. I made another date time field and got the same problem. Anyone any ideas how to troubleshoot this issue? I am running on version 2.7.2
  15. wireRelativeTimeStr($page->published) returns weird results for me, i.e. "8 hours ago" for a page I just published on a site with +9:00 as its timezone (and -5:00 as the server / MySQL timezone, but I'm not sure if that matters.) When I looked into the code, I saw that WireDateTime->relativeTimeStr() uses the numeric timestamp when that's what it's given; $page->published returns a unix timestamp, so that can't be the problem, right? Then I checked the database, and the page table stores published in MySQL's datetime format (which lacks timezone support.) It seems that the application timezone setting was not taken into account somewhere during converting the database datetime field to the internal time representation (integer unix timestamp) in the PHP Page object. "By the way," (and sorry to propose another change; people here will get tired of me so fast) wouldn't it make sense to switch to a simple integer fields, storing the unix timestamp, for the database? No more need to switch back and forth between the internal representation and MySQL's, which is sadly broken whenever timezones matter. And just, less work, right? (well, no more "current_timestamp" default value for modified, but I think there are workarounds for that ) p.s. Why is "published" uses the datetime MySQL type while created and modified use timestamp? Timestamp (which is stored as UTC in the database) would probably make more sense for "published" as well (if only for consistency) -- that is, if we wanna stick to a native time column. As a note to this specific problem, looking up the "modified" field returned damaged results as well. Edit: it's on pw 3
  16. Hi, I've just upgraded a site from 2.6.1 to 2.7 and have noticed that the 'published' date does not seem to be working on new content I publish. Under the settings tab the info looks like this: Published on [?] If I try to output the date anywhere it comes out as: 1970-01-01 01:00:00 Does anyone know why this may not be outputting correctly?
  17. Hello, in a 2.6.22rc1 install I have a page field "workshops" that selects pages via selector "template=workshop,sort=-dat_start,dat_start>=today)". The field is in a template "anmeldungen". When I edit a page with template "anmeldungen". I can choose pages from the page field "workshops". But when I want to save that page, I get an error Page 2188 is not valid for workshop (Page 2188 does not match findPagesSelector: template=workshop,sort=-dat_start,dat_start>=today) But the workshop I am trying to save to the page field is definitely in the date range >=today. Otherwise it wouldn't be listed in the page field select dropdown. The same error is thrown when I change my selector to "template=workshop,sort=-dat_start,dat_start>=2015-11-04". Also saving pages through the API to that field doesn't work. Only if I omit the dat_start>= selector, I can save pages to the page field.
  18. i did a multilanguage-install. english and german are needed i set german as default (install german languagepack at default) then add english (en) as second language my date-output is custom: %A %d %B %Y (Details Tab) echo $page->date the problem is that i always get the english ouput.
  19. So I have an odd feature to tackle. I want to include an image in the template (aka a header), but want to implement a function to set a time in the future. Once the time was met, the image will automatically come down (if possible switch to another image, but that is not something Ill worry about now). Now, I set up an image field "timed_image", and I set up the date/time field "select_timed_expire". I also know how to echo the information on the page, but where I am finding issue is actually how to implement this. I could use javascript and pass the date/time to it, but from there I am quite lost on how to implement this. Has anyone done something like this before?
  20. Hi, I'm sorry if this has been adressed before but I couldn't find anything about it. I'm pretty new to processwire but not to php or object developpment. I'm working on a blog and the request was to add a custom date field on articles that allows the user to override the "date" associated to the article. It's basically a publish date. If set, that date is used to sort the article and also if the date is in the future the article will not be displayed on the website. Here is the selector I used to sort my articles list before: $pages->find('template=news, sort=-created, limit=4'); and here is how I do it now : $pages->find('template=news,!news_date>today, sort=-created|-news_date, limit=4'); The only issue is that the sort does not sort a big mashup of all the dates regardless of whether it's in "created" or "news_date" but it sorts one and then the other. So what I get is a list of dates like this 02 jul 2015 (news_date) 15 Jul 2014 (news_date) 2 Dec 2014 (created) 1 Nov 2014 (created) The news_date list is on top of the created list. Do you know how I could achieve this? Thanks a lot
  21. Hi there, can't seem to get my head around handling user timezones the right way and hope to get some feedback from people more knowledgeable than me. My scenario: Users can set publishing date/time for pages they create through a frontend form. These should be saved in the users' timezone. I have a date field for publishing time. PW saves dates as unix timestamps to the DB. For conversion of the date/time to the timestamp PW uses the default server time zone setting (in my case Europe/Berln). Now when a user in timezone America/New_York creates a page and sets the publishing date, it will be converted to a timestamp using the server timezone Europe/Berlin and saved to the DB. Later the user checks if his page is being published at the set time in New York. But it will be published at the wrong time because the user is in a different timezone. I assume it would be best to convert the publishing date/time to a timestamp using the user timezone and save that to the DB. Am I right here? How would I accomplish that? I found date_default_timezone_set. Can I simply use this to set the user timezone before I save values, like date_default_timezone_set($userTimezone); // where $userTimezone is a string like "America/New_York" $editpage->of(false); foreach($adform as $field) { // loop through all fields and save them if(in_array($field->name, $ignorefields)) continue; $editpage->set($field->name, $field->value); } $editpage->of(true); date_default_timezone_set($config->timezone); // do I have to set it back to server timezone here?
  22. Hello, I've a date field with date input format as follows: 'l, j F Y h:i A' I've a code that creates calendar of given month & year. What I need is, I need to find pages having above field and date as per the generated calendar. From Soma's one post on forum for similar problem, I've written following code, but it's giving error $this_date_raw = $list_day."/".date('m')."/".date('Y'); $this_date = date("l, j F Y h:i A", strtotime($this_date_raw)); $day_shows = $pages->find("show_datetime={$this_date}"); foreach ($day_shows as $ds): $calendar.= "<p>{$ds->title}</p>"; endforeach; Error is as follows: Error: Call to a member function find() on a non-object (line 54 of D:\wamp\www\ticketees_site\site\templates\calendar.php) Thanks in advance.
  23. Hi all, I'm currently making a web app using ProcessWire. It will be in Danish and I am having trouble making the date render out in Danish. Any suggestions? Thanks!
  24. Hi, I have a problem with outputing months names in Polish language, Im using date filedtype, choosing date with datepicker and then outputing it in my template. i spend some times reading forums, in example this Topic: http://processwire.com/talk/topic/1751-cant-get-pw-to-output-german-month-names/ None of things work for me. in config.php $config->timezone = 'Europe/Poland'; in wire\modules\LanguageSupport\LanguageSupport.module if($locale != '0') setlocale(LC_ALL, 'pl_PL '); Still have english month names, what im doing wrong ? Regars Paweł
  25. Hi Everyone, Any help is appreciated. I'm trying to get either current and future events (pages) or past ones and am getting an error. Here's my code ... if ($page->showPastEvents) { $items = $pages->find("template=event, eventStartDate < today, limit=$page->numberOfItemsPerPage, sort=-date"); } else { $items = $pages->find("template=event, eventStartDate >= today, limit=$page->numberOfItemsPerPage, sort=-date"); } I've also tried this: $today = strtotime(date('Y-m-d')); if ($page->showPastEvents) { $items = $pages->find("template=event, eventStartDate < $today, limit=$page->numberOfItemsPerPage, sort=-date"); } else { $items = $pages->find("template=event, eventStartDate >= $today, limit=$page->numberOfItemsPerPage, sort=-date"); } And here's the error I'm getting, thoughts? Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Selectors.php line 165) #0 /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Selectors.php(190): Selectors->create('eventStartDate', '', '>= 1374033600') #1 /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Selectors.php(63): Selectors->extractString('template=event,...') #2 /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Pages.php(143): Selectors->__construct('template=event,...') #3 [internal function]: Pages->___find('template=event,...') #4 /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Wire.php(271): call_user_func_array(Array, Array) #5 /var/www/vhosts/sharespost.com/sharespost.co.v1/wire/core/Wire.php(229): Wire->runHooks('find', Array) #6 /var/www/vhosts/sharespost.com/sharespost.co.v1/site/templates/basic-page-events.php(12): Wire->__call('find', Array) #7 /var/www/vhosts/sharespost.com/sharespost.co.v1/site/templates
×
×
  • Create New...