• Resolved manevilhena

    (@himidia)


    Hello,

    I’m typing from Brazil and down here the dates are usually formatted as (d/m/Y)

    My wordpress main settings is correct but LifterLMS is formatting the dates some other way when using the shortcode [lifterlms_course_info id=”1456″ key=”start_date”]

    I tried adding date_format=”F j, Y” to the shortcode with no success:
    [lifterlms_course_info id=”1456″ key=”start_date” date_format=”d/m/Y”]

    How can I ensure that LifterLMS uses the Brazilian date format?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter manevilhena

    (@himidia)

    EDIT: I’ve managed to show the correct date format using the shortcode:
    [lifterlms_course_info id=”1456″ key=”enrollment_start_date” type=”date” date_format=”d/m/Y”].

    Ï have used type=”date and date_format=”d/m/Y”

    But is there a way to force LifterLMS to use the same date/time format as the WordPress settings?

    Plugin Support Nick Mariano

    (@reddotinmotion)

    Hi @himidia,

    I’m glad you are able to find a manual workaround. However, you mentioned that you want to force LifterLMS to use WordPress date/time settings. In this case, we recommend that you try using the llms_shortcode_course_info filter for that shortcode. That filter is defined in wp-content/plugins/lifterlms/includes/shortcodes/class.llms.shortcodes.php.

    Thread Starter manevilhena

    (@himidia)

    Thanks @reddotinmotion ! I will look for this.

    So if a make copy of ths file (wp-content/plugins/lifterlms/includes/shortcodes/class.llms.shortcodes.php), put it at my child-theme I can safely edit the date format the way I want, right?

    Thank you!!

    Plugin Support Alexander

    (@alextonio22)

    Hi @himidia ,

    You can indeed copy the class.llms.shortcodes.php file and place it in your child theme to make modifications, such as adjusting the date format. However, please note that simply placing the file in your child theme won’t override the plugin’s behavior automatically, WordPress doesn’t load PHP class files from child themes by default.

    Also, modifying core plugin files, even in a copied version, can lead to compatibility issues down the line. While placing custom code in a child theme ensures your changes aren’t lost during theme updates, future LifterLMS plugin updates could change how the original file functions, requiring you to revisit your custom code for continued compatibility. For long-term maintainability, using available hooks or filters to customize output whenever possible.

    Also, I would like to mention that we are considering an update that would make the date formatting respect your WordPress General Settings, for example, setting the format to d/m/Y in your site settings would reflect that format across your courses. While we don’t have an exact release date yet, this enhancement is on our radar.

    All the best,

    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @himidia ,

    If you update to the latest version of LifterLMS (8.0.3), the default format of these dates should match your site format.

    Any issues with it let us know!

    Thread Starter manevilhena

    (@himidia)

    hi @brianhogg, I am running version 8.0.3 already!

    Plugin Support Nick Mariano

    (@reddotinmotion)

    Hi @himidia,

    I tried using [lifterlms_course_info key="enrollment_start_date"] inside a course page when using LifterLMS 8.0.3, and it obeyed the date settings in WordPress Dashboard > Settings > Date Format. When I used LifterLMS 8.0.2, the date settings were not obeyed. Could you confirm this on your end?

    Thread Starter manevilhena

    (@himidia)

    Hi @reddotinmotion,

    Thanks, I’ve tested the shortcode without  type=”date” date_format=”d/m/Y” and now it worked!

    Now it is following the same setting as WordPress settings.

    Thanks so much!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Date Format’ is closed to new replies.