Skip Navigation

[Résolu] How to display Hours and Minutes on same line as date and changing hour label

This support ticket is created Il y a 3 années et 9 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 13 réponses, has 2 voix.

Last updated by Minesh Il y a 3 années et 8 mois.

Assisted by: Minesh.

Auteur
Publications
#1715847
date and time.png

Tell us what you are trying to do?
Hi,
I am using date and time field in a form. When I display the form it shows the hour label next to the date but the field is down. I want to make the date and time in the same line or moving the hour label down. How to do that?

#1715969

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

It looks like the hour and minute dropdown size needs to be adjusted using custom CSS.

Can you please share problem URL and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1716055

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - without problem URL I cant say anything.

I need problem URL at least where I can see the form with those fields.

#1716085

In order to view the form you need to login I can provide you with WP admin login access.

#1716097

Please set the next reply to private

#1716105

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have set the next reply to private which means only you and I have access to it.

#1716153

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now.

I've added the following CSS code to your form's CSS box:

.cred-field-date-and-time-of-incident .js-wpt-field-items select.wpt-form-select {
 width:75px !important;
 display:inline-block !important;
}

I can see its working as expected.

#1716189

My issue is resolved now. Thank you!

#1716405

How to change the hour label?

#1716917

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

As you are not using the WPML - you can change the Hour and Minute label text using the standard gettext function.

Can you please try to add the following code to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/
Or
Add it to the current theme's functions.php file:

add_filter( 'gettext', 'func_change_hour_minute_label', 20, 3 );
function func_change_hour_minute_label( $translated_text, $text, $domain ){
    if ($text === 'Hour' &&  $domain == 'wpv-views'){
            $translated_text = 'change Hour text';
    }else if ($text === 'Minute' &&  $domain == 'wpv-views'){
            $translated_text = 'change Minute text';
    }

    return $translated_text;
}

Where:
- Change the Hour and minute text as per your requirement.

#1719743

My issue is resolved now. Thank you! But I can not close the ticket and it gave me error "Duplicate reply detected; it looks as though you’ve already said that!" since I have closed it before.

#1720303

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

while closing - Can you please try to add some text. My issue is resolved with solution shared, something like that and try to mark resolve this ticket.

#1720489

Still can not close it. Could you please close it from your side.

#1720521

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Resolved 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.