Problem with current date displaying in PM v27.2.0 (x64)

Users and developers helping users with technical Pale Moon issues (Windows and other non-Linux O.S.). Please direct questions about the Linux version to the appropriate Linux board.

Moderators: trava90, satrow

Forum rules
This board is for technical/usage questions and troubleshooting for the Pale Moon browser only. The main focus here is on Pale Moon on Windows. Please direct your questions for Linux, Android and Mac to the dedicated boards.
Technical issues and questions not related to the Pale Moon browser should be posted in "technical chat"
Please keep off-topic and general discussion out of this board, thank you!
User avatar
back0rifize
Moonbather
Moonbather
Posts: 51
Joined: 2016-05-08, 02:26

Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-03-22, 22:19

Good day's time!

After updating PM to version 27.2.0, I've got an issue with current date displaying: in Russia, we have DD.MM.YYYY format, but now it shows DD/MM/YYYY. It's not critical, but I would like to know the reason: maybe there was some changes in toLocaleDateString() method or it's a localization issue, or something else?

Thank you!
Attachments
How does it look now
How does it look now
Date.png (2.84 KiB) Viewed 954 times

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 24823
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by Moonchild » 2017-03-23, 10:32

The ICU library was updated which handles internationalization. It seems the separator character has been changed but without looking into it in more detail (and without knowing exactly the code creating the date you show here) it'll be difficult to find the reason.

Yes it's possible that toLocaleDateString() has changed and that the library update introduced a bug... but some more details are needed. Can you provide some steps to reproduce and find out what is done correctly and what is done wrong? Did you check your O.S./system settings as well for the correct separator being in use?
"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne
Image

User avatar
back0rifize
Moonbather
Moonbather
Posts: 51
Joined: 2016-05-08, 02:26

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-03-23, 12:47

I saw it in the status bar, where my addon (Calendate) places current date. Moreover, I've got this issue in its main window (when 'calendate.xul' is calling). For example, here is my code:

MAIN WINDOW WITH CURRENT DATE (CALLED FROM 'calendate.core.js')

Code: Select all

var actual = 
{
	date : function ()
	{
		var dpicker = document.getElementById('calenDate-main-datepicker').value;
		var tbox = document.getElementById('calenDate-current-date');
		var today = new Date();
		today.setTime(Date.parse(dpicker));
		tbox.setAttribute('value', today.toLocaleDateString());
	}
}
CURRENT DATE IN THE STATUS BAR PANEL (CALLED FROM 'button.core.js')

Code: Select all

var notify =
{
	me: function()
	{
		// Getting formatted date
		var bar = document.getElementById('calenDate-statusbarpanel-date');
		var button = document.getElementById('calenDate-button');
		var date = new Date();
		var month = ('0' + (date.getMonth() + 1)).slice(-2);
		var day = ('0' + date.getDate()).slice(-2);
		var set = date.getFullYear() + '-' + month + '-' + day;
		date.setTime(Date.parse(set));

		// Adding current date to statusbar panel
		bar.setAttribute('label',date.toLocaleDateString());
		bar.style.fontWeight = 'bold';

//...and so on...

	}
}
What about OS: I use Win7 x64 Enterprise (about 4 years). Nothing in my OS was changed since I updated my PM from v27.1.2 to 27.2.0. Today I did a rollback to PM v27.1.1 and all got right, the separators became again "dot" instead of "slash".

Hope this information helps both of us a little bit.

PS: Right now I was checking this code in a "Simple JS Editor" (or whatever it called in PM):

Code: Select all

var date = new Date();
var month = ('0' + (date.getMonth() + 1)).slice(-2);
var day = ('0' + date.getDate()).slice(-2);
var set = date.getFullYear() + '-' + month + '-' + day;
date.setTime(Date.parse(set));
alert(date.toLocaleDateString());
and I've got the"dot"- separators. Used version: 27.1.1.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 24823
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by Moonchild » 2017-03-23, 15:05

Hmm yeah it looks like the ICU API has changed and it's not picking up the correct separators in our js engine.
Issue #976 (976) created.
"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne
Image

User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1789
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by JustOff » 2017-04-02, 17:43

back0rifize wrote:It's not critical, but I would like to know the reason: maybe there was some changes in toLocaleDateString() method or it's a localization issue, or something else?
This regression was fixed in 27.3.0a1.
Here are the add-ons I made in a spare time. That was fun!

User avatar
back0rifize
Moonbather
Moonbather
Posts: 51
Joined: 2016-05-08, 02:26

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-04-02, 20:17

Alrighty then! Отличненько!

Locked