Jump to content
You must now use your email address to sign in [click for more info] ×

Custom date formatting for fields


Recommended Posts

  • Staff

Hi Mike,

To answer your questions:

1. This is nothing to do with adding an extra hour to the times. The k/H difference is essentially what the 12am is referred to as in a 24 hour clock.

With k 12am is displayed as 24 rather than 00. Meaning the clock runs from 1am all the way through to 24am. Where as using H, 12am is displayed as 00.

The K/h difference is the same thing but with a 12 hour clock. With K 12am is displayed as 00am and h displays it as 12am. 

Here is a quick example showing these values:

Hours.png

2. From what I can tell and looking at the actual ICU documentation and their test examples (icu4c\source\test\intltest\dtfmttst.cpp inside icu-cldr-2023-08-22) this behaviour is correct. For standard English data (seen by the en, rather than en-GB) they're expecting what I'm getting for the US. For US I'm getting GMT+1 and British Summer Time, and for UK I'm getting BST and British Summer Time.

Screenshot 2023-09-04 at 09.20.55.pngScreenshot 2023-09-04 at 09.21.03.png

3. This button will update the 'Current Date & Time' of the selected field to be the current date/time, rather than what it was at time of insertion.

4. Cheers - I can confirm I am getting this in the app. I'll pass this over to documentation.

5. The example is just showing how a time zone that differs in minutes as well as hours will look. This is how UTC+04:30 Kabul looks:

image (8).png

6. Thanks I'll get this fed back to the documentation team as well.

Link to comment
Share on other sites

4 hours ago, Sean P said:

With k 12am is displayed as 24 rather than 00. Meaning the clock runs from 1am all the way through to 24am. Where as using H, 12am is displayed as 00.

The K/h difference is the same thing but with a 12 hour clock. With K 12am is displayed as 00am and h displays it as 12am. 

Oh my mistake, I misunderstood the purpose of that pattern. Sorry.

4 hours ago, Sean P said:

2. From what I can tell and looking at the actual ICU documentation and their test examples (icu4c\source\test\intltest\dtfmttst.cpp inside icu-cldr-2023-08-22) this behaviour is correct. For standard English data (seen by the en, rather than en-GB) they're expecting what I'm getting for the US. For US I'm getting GMT+1 and British Summer Time, and for UK I'm getting BST and British Summer Time.

I could swear I was seeing the reverse yesterday, that those with UK English couldn't get BST, but I can't duplicate it now so I must have been confused. Sorry.

4 hours ago, Sean P said:

3. This button will update the 'Current Date & Time' of the selected field to be the current date/time, rather than what it was at time of insertion.

At least I got one right. I thought that's what it should do and I've now figured out the steps. If you insert the current date & time field into a text frame on a document page it will update correctly but if the same field is inserted into a frame from a master layer it won't update - you can customize the formatting but not update the value.

Thanks,

Mike

Download a free PDF manual for Publisher 2.5

My system: Affinity 2.5 for macOS Sonoma 14.5, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

  • Staff
20 hours ago, MikeTO said:

At least I got one right. I thought that's what it should do and I've now figured out the steps. If you insert the current date & time field into a text frame on a document page it will update correctly but if the same field is inserted into a frame from a master layer it won't update - you can customize the formatting but not update the value.

Thanks,

Mike

Thanks for that! I've reproduced that here and will get it logged! Thanks for letting us know.

Link to comment
Share on other sites

  • 2 weeks later...
On 6/26/2023 at 9:42 AM, Ash said:
Symbol Meaning Pattern Example Output Notes
G era designator G, GG, or GGG
GGGG
GGGGG
AD
Anno Domini
A
       

Looks like you have omitted CE and BC(E). I would add those, and give them the name ‘Common Era’ and ‘Before Common Era’ respectively.

Link to comment
Share on other sites

Hi @tatanka,

I don't believe they've been omitted, they're simply not included as part of the ICU spec...

https://unicode-org.github.io/icu/userguide/format_parse/datetime/

Affinity Designer 2.5.0 | Affinity Photo 2.5.0 | Affinity Publisher 2.5.0
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

48 minutes ago, vlimm said:
In your "custom date formatting" section, I would suggest one modification:
 
 
This number would make more sense if the output values were 1-12. (i.e., We would never say 0 AM. We would say 12 AM.)

If I understand what they've implemented, they're just following the Unicode standard.

Ash mentioned early in this topic that they follow https://unicode-org.github.io/icu/userguide/format_parse/datetime/

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.5, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.5

Link to comment
Share on other sites

Yes, I saw that too. However, unless Affinity is willing to put in coding that will allow us to mathematically manipulate those numbers (e.g., K+1), this custom formatting is not terribly useful. I understand that following the Unicode standard is a good general principle, but if Affinity wants to avoid providing additional programming capability, a few tweaks are going to be needed to make this custom formatting meaningful.

Link to comment
Share on other sites

After 23:59:59 comes 00:00 which is a start of a new day. So, it is absolutely OK. 

All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows.
15” Dell Inspiron 7559 i7 Windows 10 x64 Pro Intel Core i7-6700HQ (3.50 GHz, 6M) 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) NVIDIA GeForce GTX 960M 4 GB GDDR5 500 GB SSD + 1 TB HDD UHD (3840 x 2160) Truelife LED - Backlit Touch Display
32” LG 32UN650-W display 3840 x 2160 UHD, IPS, HDR10 Color Gamut: DCI-P3 95%, Color Calibrated 2 x HDMI, 1 x DisplayPort
13.3” MacBook Pro (2017) Ventura 13.6 Intel Core i7 (3.50 GHz Dual Core) 16 GB 2133 MHz LPDDR3 Intel Iris Plus Graphics 650 1536 MB 500 GB SSD Retina Display (3360 x 2100)

Link to comment
Share on other sites

  • 4 weeks later...
Just now, anto said:

I cannot upload because file has private data.

I'll try to create new ones and attach it.

Completely understand so any random data is fine just formatted using the same date format...

Affinity Designer 2.5.0 | Affinity Photo 2.5.0 | Affinity Publisher 2.5.0
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

@anto,

When I open your file (for me) the dates are all formatted using '/'s

dates.png.71d205e85367e986b0aa31f806dfc21a.png

 

Try the attached file and see if it works for you on Windows or whether you see the same issue...

test_date_merge_new.xlsx

Affinity Designer 2.5.0 | Affinity Photo 2.5.0 | Affinity Publisher 2.5.0
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

Maybe it is a Windows issue, perhaps others using Windows can also test this to see if they see the same issue with both your original file and my updated file and report back.

In the meantime, could you confirm your OS language and the Language setting you're using in Publisher which I assume is either English or English (United States)?

Affinity Designer 2.5.0 | Affinity Photo 2.5.0 | Affinity Publisher 2.5.0
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

50 minutes ago, anto said:

When i open your file it seems to work, but when i press Save, it does not work.

When I use @Hangman's xlsx file it works, and even if I open it in LibreOffice and re-save it, it still works for Data Merge in Publisher.

LibreOffice tells me that your file, @anto, is formatted using the / format rather than the . format.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.5, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.5

Link to comment
Share on other sites

4 minutes ago, walt.farrell said:

LibreOffice tells me that your file, @anto, is formatted using the / format rather than the . format.

That is what Excel, Google Sheets and Apple Numbers all tell me as well...

Affinity Designer 2.5.0 | Affinity Photo 2.5.0 | Affinity Publisher 2.5.0
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

2 minutes ago, anto said:

what does this mean?

That you created it using the / format, as far as LibreOffice can tell (and as far as Excel, Google Sheets, and Apple Numbers can tell).

What application did you use to create the file you shared with us? Can you open that test file in that application and show us the Date-formatting options you used?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.5, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.5

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.