Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 24h time #524

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h2 class="card-title"></h2>
{{ block?.block?.header?.proposer_address }}
</td>
<td>{{ block?.block?.data?.txs?.length }}</td>
<td>{{ block?.block?.header?.time | date : 'yy/MM/dd hh:mm' }}</td>
<td>{{ block?.block?.header?.time | date : 'yy/MM/dd HH:mm' }}</td>
</tr>
</ng-container>
<ng-template #empty>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code patch changes a date format in an Angular template. Instead of using lowercase "hh" for the hour, it uses uppercase "HH", which represents the 24-hour clock. This is a minor improvement that eliminates the ambiguity between AM and PM times.

There don't seem to be any obvious bug risks with this code patch, as it only affects the presentation of data on the front end. However, it may be worth checking if the change impacts any other parts or components of the application.

Overall, this seems like a harmless and helpful update to the code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="card-title">Latest Blocks</h2>
{{ block?.block?.header?.proposer_address }}
</td>
<td>{{ block?.block?.data?.txs?.length }}</td>
<td>{{ block?.block?.header?.time | date : 'yy/MM/dd hh:mm' }}</td>
<td>{{ block?.block?.header?.time | date : 'yy/MM/dd HH:mm' }}</td>
</tr>
</ng-container>
<ng-template #empty>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the provided code patch, it appears that the only change made was to modify a date format string. The hh token was changed to HH, which means that the hours will now be displayed in a 24-hour format instead of a 12-hour format.

There do not seem to be any bug risks associated with this change, as it is simply a formatting adjustment. However, if there are specific requirements around how the time should be displayed (such as displaying the time zone or using a different format), those could be additional improvements to consider.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2 class="card-title">Transactions</h2>
{{ tx.txhash }}
</th>
<td>
{{ tx.timestamp | date : 'yy/MM/dd hh:mm' }}
{{ tx.timestamp | date : 'yy/MM/dd HH:mm' }}
</td>
</tr>
</ng-container>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code patch updates the time format of a transaction from using 'hh:mm' to 'HH:mm', where 'HH' means 24-hour time. This can be an improvement for clarity and consistency in time presentation if users are accustomed to the 24-hour time format.

However, without further context and information about the requirements and use case of this code, it's difficult to identify any potential bug risks that may result from this change or suggest further improvements.

Expand Down
2 changes: 1 addition & 1 deletion projects/explorer/src/app/views/txs/txs.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{{ tx.txhash }}
</th>
<td>
{{ tx.timestamp | date : 'yy/MM/dd hh:mm' }}
{{ tx.timestamp | date : 'yy/MM/dd HH:mm' }}
</td>
</tr>
</ng-container>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code patch appears to be a minor change in the format of timestamp displayed for a transaction. The 'hh' has been replaced with 'HH' in the date filter, indicating that the hours will now be represented in 24-hour format rather than 12-hour format.

There don't seem to be any obvious bug risks associated with this change. However, it's possible that there may be other parts of the code where the timestamp format is being used or parsed and this change could affect those parts as well. It's always a good idea to test the changes thoroughly before deploying them to production.

As for improvement suggestions, without any additional context or information about the codebase, it's difficult to provide any specific recommendations.

Expand Down