Publisher is EE6 compatible, but it does not support the Fluid field. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: fieldname:length format

Status Resolved
Add-on / Version Reel
Severity Trivial
EE Version

Michael Kelleher

Oct 27, 2012

Is there any easy way of formatting the time returned in mins and seconds? Been looking into this for the last hour with no luck. Any help would be appreciated.

 

#1

BoldMinded (Brian)

Oct 27, 2012

The times returned are unix timestamps, so you should be able to use the native EE format parameter, e.g. {time format=”%s”}

#2

Michael Kelleher

Oct 27, 2012

I’ve tried {fieldname:length format=”%I %s”} but it returns only a second value. Combing through the forums at the moment for something similar. Thanks for the prompt reply.

#3

BoldMinded (Brian)

Oct 29, 2012

What is the value of :length without the format parameter?

#4

Michael Kelleher

Oct 29, 2012

{fieldname:length format=”%I %s”}  and {fieldname:length} both return the same value (in seconds).

#5

BoldMinded (Brian)

Nov 01, 2012

Michael, can you post a URL where this is happening? Would you be able to put both variables in the page so I can see the output of both, e.g.

{fieldname:length}
{fieldname:length format=”%l %s”}

#6

Brian Litzinger

Nov 09, 2012

MIchael, have you figured this out yet?

#7

Michael Kelleher

Nov 17, 2012

Brian,

I send you a CP login last week. Did you get a chance to look at this?

#8

BoldMinded (Brian)

Nov 26, 2012

I did not, sorry. It dropped off my radar. Will look at it this week.

#9

Michael Kelleher

Nov 27, 2012

Thanks Brian.

While you are looking. My client is having issues adding vimeo videos. They can add youtube ones without a problem. I can’t replicate the problem on this end. Same os (Mountain Lion) and browser (firefox 10.74). Running Wyvern Video 1.2.2 and EE 2.52. Only difference is I’m logged in as superadmin and they’re admin. Can’t see this as an issue however as they can submit youtube videos. Any ideas?

#10

BoldMinded (Brian)

Nov 27, 2012

My first guess would be to look at the console if possible to see if there are any javascript errors.

#11

BoldMinded (Brian)

Nov 27, 2012

As for the formatting, I’ll have a fix sent to you soon.

#12

Michael Kelleher

Nov 28, 2012

Thanks Brian,

Time formatting working fine now. I’ll open another thread on the vimeo issue just for clarity.

#13

Michael Kelleher

Dec 28, 2012

Brian,

I think I’ve come across a further bug with getting the time format output. I needed to include the WYVERN video as part of a ‘cartthrob package’. If I try to include the time formatting within the cartthrob package tag pair the formatted video length outputs nothing.

e.g.
{cartthrob_package}
Duration: {fieldname:length format=’%i’}mins {fieldname:length format=’%s’}secs
{/cartthrob_package}

The strange thing is an unformatted time stamp is output if I remove the format tag or if I call an unformatted time stamp first the formatted version will output after without a problem

e.g.

Duration: {fieldname:length} {fieldname:length format=’%i’}mins {fieldname:length format=’%s’}secs

Again any help is appreciated.

#14

BoldMinded (Brian)

Dec 28, 2012

The same temate code works fine outside of the cartthrob tag pair though? Did you try formatting the current_time variable inside the cartthrob pair to see I’d the format param works?

#15

Michael Kelleher

Dec 28, 2012

Inputting {current_time format=’%i’} returns current minutes formatted correctly.

The same template code works in other templates. The cartthrob tag pair is some kind of relationship field specific to cartthrob packages (http://cartthrob.com/docs/fieldtypes/packages/index.html)

Pulling in {fieldname:length} unformatted works fine in the tag pair as does {fieldname:thumbnail_large}

Currently as a workaround I’m calling in {fieldname:length} wrapped in a span and hiding with css. Not ideal but it is helping {fieldname:length format=ā€™%iā€™}mins {fieldname:length format=ā€™%sā€™}secs to get the correct values somehow.

#16

BoldMinded (Brian)

Dec 30, 2012

Michael, would you be able to edit this ticket and add FTP access in the fields provided? Only I will see them. Otherwise I’m going to have to spend a couple of hours just configuring Cartthrob to replicate this.

#17

BoldMinded (Brian)

Jan 14, 2013

Took this offline to email, and I think its working now? If not, please open a new ticket, or just update me in the email thread. Thanks.

Login to reply