snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Date localization not working on custom fields

Open pdklein88 opened this issue 6 years ago • 12 comments

Please confirm you have done the following before posting your bug report:

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create custom field in Settings > Custom Fields
  2. Set format to DATE
  3. Edit the asset and set the date field

Expected behavior Date field should show proper format as selected in Localization page. Purchase date is a standard field that works as expected.

Screenshots I can't figure out how to upload a screenshot, so I'll retype what I am seeing:

Last Annual Maintenance 2019-09-13 Purchase Date 08/08/2018

Is this a fresh install or an upgrade? Fresh Version of Snipe-IT you're running 4.9.2 build 4352 Version of PHP you're running 7.3.19 Version of MySQL/MariaDB you're running What OS and web server you're running Snipe-IT on Windows Server 2019

pdklein88 avatar Jun 17 '20 15:06 pdklein88

The screenshot (file) is simply dragged into the message body

UserGoodtm avatar Jun 17 '20 22:06 UserGoodtm

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Aug 16 '20 23:08 stale[bot]

Yes

On Sun, Aug 16, 2020 at 7:24 PM stale[bot] [email protected] wrote:

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/8143#issuecomment-674591509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIWUSXAIRVJYNGLWRTISQ3DSBBTCNANCNFSM4OAXWNJQ .

-- Sent from Gmail Mobile

pdklein88 avatar Aug 17 '20 21:08 pdklein88

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Aug 17 '20 21:08 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Dec 25 '20 21:12 stale[bot]

I'll try to drop it here as I have this problem also:

Custom field name: Warranty ends

Chosen format on /admin/localization: image Display format on Asset page: image

Custom Fields configuration view: image

Issue still persists on v. 5.1.5 - build 6055 PHP: v. 7.4.3 OS: Ubuntu 20.04 MySQL: v. 8.0.25

kamlot-it avatar May 17 '21 12:05 kamlot-it

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar May 17 '21 12:05 stale[bot]

We are seeing this as well. Snipe-IT v5.4.1 - build 6746. Ubuntu 20.04, PHP 7.4.3, Apache 2.4.41, MariaDB 10.3.32.

We have "Ship Date/Warranty Start" and "Warranty End" custom fields with the format set to DATE. In Localization settings, "Time and Date Display" is set to mm/dd/yyyy.

Here's an example when viewing an asset:

Ship Date/Warranty Start 2019-08-11 Warranty End 2022-08-11 Purchase Date 08/08/2019

dg-td avatar Mar 08 '22 23:03 dg-td

Looks like a common problem... Let me see what I can do.

inietov avatar Mar 09 '22 00:03 inietov

In Snipe-IT v5.4.2 this bug has been fixed in some places but not others.

We have "Ship Date/Warranty Start" and "Warranty End" custom date fields. In Localization settings, we have "Time and Date Display" set to mm/dd/yyyy.

If you view an asset and look in the Info tab, the custom fields now show up correctly, as mm/dd/yyyy, as of Snipe-IT v5.4.2. See the screenshot below. In v5.4.1 and earlier, before the bug fix, they showed up incorrectly as yyyy-mm-dd.

snipe-it-asset-detail

If you go to the Dashboard and click the "total assets" button, and then search for assets, the custom fields still show up incorrectly as yyyy-mm-dd. See the screenshot below, where the two fields are shown next to a standard (non-custom) field, Purchase Date.

snipe-it-asset-search

We are running Snipe-IT on Ubuntu 20.04, with PHP 7.4.3 and Apache 2.4.41.

dg-td avatar Apr 12 '22 14:04 dg-td

This is still a problem in v6.0.2. I went to demo.snipeitapp.com and created a custom date field called TestCustomDateField, and entered a date for one laptop.

In Dashboard -> Assets button -> view all, the date shows up incorrectly in the table in yyyy-mm-dd format. It doesn't match the format set in "Time and Date Display" in the Localization settings. Here is a screenshot with the date circled:

All Assets

If you click on the Asset Tag to go to the "View Asset" page, the format is correct. It matches the format set in the Localization settings. The update in v5.4.2 fixed the date format here, but not in the "All Assets" list as shown above.

View Asset

dg-td avatar May 27 '22 19:05 dg-td

Thanks for the heads up @dg-td. I overlooked it in my first attempt... but that's why the community is so important. I think now it's good to go. Thanks again!!

inietov avatar Jun 07 '22 23:06 inietov