Jump to content

Search the Community

Showing results for tags 'datetime'.

  • 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

Found 16 results

  1. Hello, How do I get the next Monday after the next Monday? I have that, that works and then I don't find how to add 7 days to it : $str = datetime('Y-m-d', 'next monday');
  2. Hi, We have 'Seminar_Schedule' repeater field in the template (One of the Admin Control Panel Page) Inside the 'Seminar_Schedule' repeater field (parent), we have 'SS_Datetime' repeater field. Inside the 'SS_Datetime' repeater field (child), We have 'SS_Startdatetime' and 'SS_Enddatetime' fields. How to do validation for 'SS_Startdatetime' and 'SS_Enddatetime' fields for below cases. Disallow creating duplicate items with the same date and time The 'SS_Startdatetime' value must not set within the range of existing items 'SS_Startdatetime' and 'SS_Enddatetime' fields. Similarly, The 'SS_Enddatetime' value must not fall within the range of existing items 'SS_Startdatetime' and 'SS_Enddatetime' fields.
  3. Hi guys, the field "redirect_last" of type DateTime got not updated. The update on the field "redirect_counter" works and got saved. Does anybody know what I did wrong in my code? if ($input->urlSegment(1) === 'redirect') { $page->of(false); $page->redirect_last = time(); $page->redirect_counter += 1; if ($page->save('redirect_counter')) { $session->redirect($page->website_url, 302); } } Thanks.
  4. Hi Guys I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer. So I duplicated the module and placed it under /site/modules/. I have added 3 new Settings to the InputfieldDatetime Module. 1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING 2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING 3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY The Problem Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right. What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select. But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again. The time select doesn't get change when you select a date 1 time and don't close the picker. Here is the whole extended InputfieldDatetime Module. The Files that I have changed: InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version Thats the Part of the JS that is not working correctly: if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is? InputfieldDatetime.zip Kind Regards Orkun
  5. Hello forum! Our customer wants to choose only 15 minute intervals in the inputfield Datetime. So the dropdown values would be: 0, 15, 30 and 45. Is there an easy way to achieve this? Any help is appreciated ?
  6. Hi, I am new to process wire and I've been trying to change the date time format in my webpage according to its language selection(example: English 'd/m/y' , Deutsch: 'd.m.y'). I know that using $datetime->getDateFormats(); we can achieve the type of formats in the shape of indexes. Also, by using $user->language->id we can know which language we are using. How do I combine this two functions so that when I select English/Deutsch, the date will be adjusted accordingly? Is there a specific function that can do this or is there any provided index in the $user->language somewhere. Thanks in advance :).
  7. 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 :).
  8. Hi everyone, Currently I'm struggling with a filter option and I hope somebody can help or advise me the right way to this. What I want is an index page where campaigns are shown and where I can filter the campaigns by year. Each campaign has a datetime field with the output set to "j F Y", so it shows "1 April 2016" in the frontend. The dates are unique for each campaign, but there can be multiple campaigns in the same year. The page structure is: -client --campaign-a --campaign-b --campaign-c --campaign-d This is the PHP code I use on the client page to display all the campaigns. $campaigns = $page->children("sort=sort"); foreach ($campaigns as $campaign) { if($campaign->campaign_description) { echo '<div class="campaign-description info">'; echo '<h2>' . $campaign->title . '</h2>'; echo '<p>' . $campaign->campaign_description . '</p>'; // Todo remove only for testing $campaignDate = $campaign->campaign_date; $campaignYear = substr($campaignDate, -4); echo '<i>' . $campaignDate . '</i>'; echo '</div>'; } } $campaignYear is where I see the years, 2015, 2016, 2017 and so on. Here I create the dropdown to show the unique years: if (count($campaigns)) { // Store unique Years $arr = array(); foreach ($campaigns as $campaign) { $campaignDate = $campaign->campaign_date; $campaignYear = substr($campaignDate, -4); $arr[] = $campaignYear; } $unique_years = array_unique($arr); // Show dropdown with unique years echo '<select id="campaign-date-select">'; foreach($unique_years as $year) { echo '<option value="' . $year . '">' . $year . '</option>'; } echo '</select>'; } I read a couple of articles, for example this: https://processwire.com/talk/topic/8513-sort-with-select-dropdown/ but I can't figure out how to dynamically change the output of the campaigns, based on the input of the select options. Maybe the datetime field is not the best option, or maybe I have to use URL segments and JavaScript to combine something... Any help or advise is welcome!
  9. Hello Community On my website I have a newsfeed, where I want to display the datetime of when the article was published. I know there is a module called "ProcessWirePublishDate". But is it possible that it only returns the date without the time? How could I fix it. Thanks for helping
  10. Hi everybody! As I may have already wrote, I really like processwire. After a short time of not knowing whether this thing is really able to get everything going (= bigger more complex sites), this slowly kicks of. Coming from MODx processwire really is a treat - and a lot faster! So now: I just tried adding a new field which I named "book_exhibit_year" used the type "Datetime" and tried setting the "Date/Time Output Format Code" to "Y" (year with four digits) and also did the same with "Date Input Format Code". My customer wants to add his own "books" as child pages and requires them to have them sorted by exhibition year. To make it as easy as possible I want him/her to be ONLY to enter years - not whole datetimes... I also thought about just using a simple "text", but then I maybe not able to sort all child pages based on the year (?). Long story short: using only "Y" (see above) will not save anything. If I enter "2014" it will always reset to "1970". I suppose the datetime expects "good" (whole) dates... I'm out of ideas right now. Maybe using a text field and then converting the value to a datetime object? Thanks!
  11. I have set the right Datepicker translation file "/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js". And change the code from: /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff (mail@milianw.de). */ jQuery(function($){ $.datepicker.regional['de'] = { closeText: 'schließen', prevText: '<zurück', nextText: 'Vor>', currentText: 'heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], weekHeader: 'KW', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['de']); }); to: /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff (mail@milianw.de). */ jQuery(function($){ $.datepicker.regional['de'] = { closeText: 'schließen', prevText: '<zurück', nextText: 'Vor>', currentText: 'heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], weekHeader: 'KW', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['de']); $.timepicker.regional['de'] = { timeText: 'Uhrzeit', hourText: 'Stunde', minuteText: 'Minute', secondText: 'Sekunde', millisecText: 'Millisekunde', timezoneText: 'Zeitzone', currentText: 'jetzt', closeText: 'schliessen', }; $.timepicker.setDefaults($.timepicker.regional['de']); }); But it only affects the date and not the time. What I'm missing?
  12. 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?
  13. I need to have a time field, for a recurring class start and end; i can't do it with the built in date/time field because i don't need the date... i was wondering if anyone had already come up with a way to implement a time value without date.. something like this? https://drupal.org/project/timefield i previously implemented a time picker on a formbuilder form which allowed you to pick time only; maybe i'll need to build a module to put the time selector in a text field on my form... maybe something like this http://jonthornton.github.io/jquery-timepicker/
  14. 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!
  15. Hey, I need to select some pages that have a datetime between 2 user input datetimes. Now I use the datetime from pw and in the selector i try to select it with $r = $pages->find("template=transaction, datetime>=$start_date, datetime<=$end_date); Now my $start_date and $end_date are formatted by 31-12-2012 but also tried 2012-12-31 And when i try to select a page with a datetime of 03-12-2012 with <=04-12-2012 i get nothing and if 07-12-2012 i get all the pages... What am I doing wrong? Thanks in advance, sorry for the weird explaination, its friday. So i figured out what the problem was, it was something in the code later on... I am stupid D:
  16. Hi everyone, is it possible to edit the "created" field of a page I create via the API? I tried $page->created = '2011-03-23 16:37:07'; as well as inserting a Unix timestamp but "created" is always "now" ... (Background: I'm getting page data from an external server and to keep this sorted right with all the other pages (like in search results) I don't want to use a custom date field.) Thanks, thomas
×
×
  • Create New...