Skip to content

Standardize date formats in item headers #132

Closed
campb303 opened this issue Dec 2, 2020 · 2 comments
Closed

Standardize date formats in item headers #132

campb303 opened this issue Dec 2, 2020 · 2 comments
Assignees
Labels
enhancement Request for a change to existing functionality high-priority Needs immediate extra focus

Comments

@campb303
Copy link
Collaborator

campb303 commented Dec 2, 2020

Currently item header dates are as authored by queue-cli:

"headers": [
	{
		"type": "Edited-Time",
		"content": "Mon, 11 May 2020 09:33:25 -0400"
	},
	{
		"type": "Assigned-To-Updated-Time",
		"content": "Tue, 05 May 2020 14:05:07 EDT"
	},
	{
		"type": "Date",
		"content": "Tue, 5 May 2020 18:02:57 +0000"
	}
]

Any dates within the headers should be standardized using the __getFormattedDate() helper function. The fields that contain times are limited and need to be determined. This is what I could see from fields that contain 2020 in their content:

Screen Shot 2020-12-02 at 3 14 33 PM

@campb303 campb303 added api enhancement Request for a change to existing functionality high-priority Needs immediate extra focus labels Dec 2, 2020
@campb303 campb303 added this to the v1 milestone Dec 2, 2020
@benne238
Copy link
Collaborator

benne238 commented Dec 3, 2020

Standardization Fix

The headers are parsed based on the the inclusion of a colon in each header line, for example item ce 100 in q-snapshot:

Time-Updated-Time: Tue, 23 Jun 2020 13:28:50 EDT
Time-Updated-By: campb303
Replied-Time: Tue, 23 Jun 2020 13:28:48 -0400

would be parsed into a header list like this:

[
     {"Type": "Time-Updated-Time", 
      "Content": "Tue, 23 Jun 2020 13:28:50 EDT"},

     {"Type": "Time-Updated-By", 
      "Content": "campb303"},

     {"Type": "Replied-Time", 
      "Content": "Tue, 23 Jun 2020 13:28:48 -0400"}
]

To standardize the dates, the __getFormattedDate() is now used to format any content with the following types:

[
     "QStatus-Updated-Time",
     "Status-Updated-Time",
     "Edited-Time",
     "QTime-Updated-Time",
     "Merged-Time",
     "Time-Updated-Time",
     "Replied-Time",
     "Assigned-To-Updated-Time",
     "QAssigned-To-Updated-Time",
     "Date",
     "Sent"
]

The resultant json now looks like this:

[
     {"Type": "Time-Updated-Time", 
      "Content": "2020-06-23T13:28:50-0400"},

     {"Type": "Time-Updated-By", 
      "Content": "campb303"},

     {"Type": "Replied-Time", 
      "Content": "2020-06-23T13:28:48-0400"}
]

@campb303
Copy link
Collaborator Author

campb303 commented Dec 3, 2020

Fixed in #134 . Closing.

@campb303 campb303 closed this as completed Dec 3, 2020
Sign in to join this conversation on GitHub.
Labels
enhancement Request for a change to existing functionality high-priority Needs immediate extra focus
Projects
None yet
Development

No branches or pull requests

2 participants