Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-09-24 00:50:02

Basebollfoto
Member
From: Norrtälje, Sweden
Registered: 2017-04-17
Posts: 38
Website

Date format on download page

Hi guys,

I am in the middle of setting up my page and there are a few things I haven't found yet. I will use separate posts for my questions.

In the download page the expiry date format is in the default format "October 15 2017 2:53pm".

In Backlight Settings, Advanced Settings, I found 'Timezone' which I thought would solve the issue. I changed it to "Europe/Stockholm" but I still have the same format on the download page

Offline

#2 2017-09-24 08:20:07

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Date format on download page

We don't support localisation of dates.  One option is to change the format to use number and not words.  To do so, copy or rename the file backlight/env.php.skel to env.php, and add a DOWNLOAD_EXPIRY_FORMAT entry near the top like this:

<?php

define('DOWNLOAD_EXPIRY_FORMAT', 'd.m.Y g:ia');

The above example will format dates like this: 

23.10.2017 10:34pm

To remove the pm, and use 24 time instead, use the format:

<?php

define('DOWNLOAD_EXPIRY_FORMAT', 'd.m.Y H:i');

To swap month for year, swap 'd' and 'm' around.  A full list of available options can be found at http://php.net/manual/en/function.date.php

Offline

#3 2017-09-24 18:41:36

Basebollfoto
Member
From: Norrtälje, Sweden
Registered: 2017-04-17
Posts: 38
Website

Re: Date format on download page

Worked like a charm!! Thank you for the rapid reply!

Offline

#4 2017-09-25 17:28:36

Basebollfoto
Member
From: Norrtälje, Sweden
Registered: 2017-04-17
Posts: 38
Website

Re: Date format on download page

Follow up question; if chagning Backlight Settings, Advanced Settings, 'Timezone' doesn't change this, what does it do? The help text states: "The timezone used for formatting days, such as download expiry"

Offline

#5 2017-09-25 19:20:36

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Date format on download page

That should display the time according to the timezone.  For example, if you had set it to Australia/Melbourne and somebody checked out at this very moment, the expiry would show 8.20pm.  If set to Sweden, it would say 12.20pm. 

Submitting this before the clock changes to 8.21pm.

Offline

#6 2017-09-25 19:59:04

Basebollfoto
Member
From: Norrtälje, Sweden
Registered: 2017-04-17
Posts: 38
Website

Re: Date format on download page

Gotcha! Then it is still good that I changed it smile

Offline

Board footer

Powered by FluxBB