Search the Community

Showing results for tags 'date'.



More search options

  • 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

  • ProDrafts
  • ListerPro
  • ProFields
  • ProCache
  • Form Builder
  • Likes
  • ProDevTools
  • Custom Development

Categories

There are no results to display.


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

Found 27 results

  1. 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 :).
  2. 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.
  3. 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?
  4. 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.?
  5. 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
  6. 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).
  7. 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
  8. 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?
  9. 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!
  10. kreativmonkey

    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?
  11. 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
  12. erikvanberkum

    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
  13. 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
  14. Sanyaissues

    Hi all, I have some pages with a custom datefield who stores the birth of the person. I want to show a list with the birthdays of the current month but i don't now how to get all the pages that match the condition. I know that this doesn't work but it reflex what i'm trying to achieve: $today = getdate(); $currentmonth = $today[month]; //november $people = $pages->get("/people/")->find("birthday~=$currentmonth"); //voila i get all the people who born on november! birthday is an custom datefield... Anybody could spare me a tip? Thanks!
  15. 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?
  16. 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.
  17. 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.
  18. 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?
  19. 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?
  20. 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ł
  21. 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.
  22. 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!
  23. 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
  24. I'm trying to build a date input field with following functionality: - Date can be manually typed using format dd.mm.yyyy - Date can be selected using datepicker (which should output the date in dd.mm.yyyy format) The problem is that the date field only accepts dashes (-) as a separator so the date must be entered using format mm-dd-yyyy. Also, when a date is selected using datepicked, it is outputted in mm-dd-yyyy format. How can I change the format to dd.mm.yyyy? I tried to change the format settings but it had no effect. My settings: I'm using Processwire 2.3.0. EDIT: The datepicker works correctly in admin section but not in my front-end custom page.
  25. tinacious

    Hi everyone, I'm wondering what the best way to sort a page by date is. I have a few pages that render a list of pages based on specific criteria, e.g. template. I want to provide 2 date pickers on each of those pages to allow users to search by date range on that specific page. I'm wondering what the best way to go about it is. The date has formatting attached to it. I'm wondering if I should use the unformatted version instead of the formatted one. Would this make it easier to work with in this situation? I was thinking of using jQuery UI datepickers and a button to submit the form and apply the date range filter to the results that are rendered on the page. if($page->id == 1) { $events = $pages->get("name=event")->children; } else if($page->name == 'users') { $events = $pages->find("created_users_id=$username, template=log-item"); } else { $sort_type = $page->template; $events = $pages->find("$sort_type=$page"); } if(count($events)) { foreach($events as $event) { // ... } } The date I will be working with has been stored in the $page->date_start field. Currently it is formatted using ProcessWire's options. I'm wondering what the best way to tie date filtering functionality into the above query would be, if even possible, and if not, which way should I go about doing it? Thanks!