We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Blind Date - use human readable dates in the CP & SAEFs

Development and Programming

Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

Hi Lotenberg - I can add this into the extension for you, but unfortunately I’m slammed right at the moment. It’s now on the to-do list and I’ll definitely post again when I’ve got it in - hopefully not more than a week or so.

Sorry for the delay!

       
Ryan 2010's avatar
Ryan 2010
265 posts
16 years ago
Ryan 2010's avatar Ryan 2010

Hi Brian,

Thanks for doing this! You’re a great guy

Ryan

       
Clearpeak's avatar
Clearpeak
413 posts
16 years ago
Clearpeak's avatar Clearpeak

Hi Brian,

I’d like to try to use this plugin but I can’t figure out how it works. I’ve installed it but i’m not sure what to do next. How exactly does it work? I would like people to enter a date in the saef via an input field and have that correspond to a custom date field in the cp. Is that what this does?

Thanks a lot.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

Hi fodney,

Basically all this extension really does is allow you to enter dates into a date field in a more ‘readable’ way. This applies in both a SAEFs and the CP. By default, the system requires all date fields to have a format of: “2008-11-07 08:51 AM”. That’s not very easy to type in! If you use this plug-in, you could enter that same date any number of ways, and it allows you to only input what you want (you don’t have to input an hour or minute for instance):

Nov 11th, 2008, 8:51 AM Nov 11th, 2008

Would both be valid dates using Blind Date, and they would throw an error if you don’t use this extension.

It sounds like you don’t really need this extension to do what you want (although it might make entering the date on the SAEF easier). What you want to do is the default behavior of EE I believe - you set up a custom date field in the CP for your weblog, and then set up a SAEF for that weblog.

By default Blind Date will be applied to the ‘normal’ date fields that exist for all entries (entry_date, expiration_date, etc.) If you want it to be applied to custom web fields (like the one you created for your SAEF), then you would enter the name of the custom field in the settings of the Blind Date extension, so it knows you want human-readable dates to be allowed for your field.

I’ve been thinking of rewriting the extension and instructions to be less cute and more functional - that would probably have saved you some time…

Let me know if you need more help setting it up.

Side note to Logtenberg - I should have a new version of the extension ready either later today or definitely this weekend.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

There is a new version up: 1.3

It changes the ‘sweaty palms’ setting in the extension settings so that, when on, it will make the entry expire the same day at 11:59, but ONLY if no expiration date is entered.

Also I modified it so it will throw a custom error message if it runs into a date it can’t parse. You can modify the language in the language file…

Cheers!

EDIT: you can find it in the initial post in this thread…

       
Clearpeak's avatar
Clearpeak
413 posts
16 years ago
Clearpeak's avatar Clearpeak

Brian,

Thanks so much. I get it now. That really works great. I’m gonna use it. I prefer it to having all the js of the calendar picker in the saef.

What if you had more than one custom date field that you wanted to use this with on a site? Can you enter multiple custom fields in the settings?

Thanks again.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

Yep you can enter multiple fields in any of the settings - separate field names with a |. 😊

       
Clearpeak's avatar
Clearpeak
413 posts
16 years ago
Clearpeak's avatar Clearpeak

Great, thanks. Do you know if there is anyway to make the custom field your submitting default to fixed rather than localized? I’m trying to avoid the whole DST issue.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

I don’t know, but that doesn’t mean it can’t be done 😉 It might be worth posting that question in a more frequented part of the forums.

DST is a huge pain in the rump, that’s for sure.

       
sapid's avatar
sapid
27 posts
16 years ago
sapid's avatar sapid

fodney,

In a SAEF you could set the selection to fixed and hide it.

<select name='field_offset_90' class="hide">
 <option value='y'>Localized</option>
 <option value='n' selected='selected'>Fixed</option>
</select>
       
sapid's avatar
sapid
27 posts
16 years ago
sapid's avatar sapid

Hey Brian,

I’m setting a custom_date_field using Punctual to a Fault (force 12:01 AM), but I’m noticing that the seconds vary for entries. Should blinddate set this custom field to have identical times down the second?

If not is their an easy way to make it do that?

thanks

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

Hi saphid,

I have to admit I’m not quite sure why that is happening (it shouldn’t be), but can you try this and see if it fixes your problem?

       
sapid's avatar
sapid
27 posts
16 years ago
sapid's avatar sapid

Thanks Brian, I updated to the latest version and ran some tests with different settings for the following fields: entry date, expiration date, and a custom test date field. See the test results link below.

For each entry I used different settings. On the first three entries a set all 3 fields and each time the seconds would vary, but on the entry where I left the test_date empty the entry and expiration dates were set correctly at :00 seconds.

Date testing results

Unfortunately, I’m not a programmer so I don’t know why the results vary.

The reason I want to set the entry times down to the second is because I’m trying to orderby and sort entries using the custom date, along with other fields, but can’t unless the entries have set times down to the second.

Thanks for your help.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

Hi sapid - thanks for doing that. I’ll look at those and see if I can’t figure out what is going on - I’ll probably give you a script to run on your server just to do some testing outside of this plug-in. Is this a dev box (local) or a live server? I’ll try to get to this today - hang tight!

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

sapid, could you take this file and put it on the same server as your site (this is totally independent of your EE install though - just put it somewhere you can access). Then point your browser to that file and tell me what results you get.

The theory here is that if you get funky results (the seconds shifted like you’re seeing currently) then the problem is something with the server (or possibly a bug with the PHP version they’re using??), if you get correct results here, then the problem is with the extension.

Thanks! (let me know if you need help using this file):

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.