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(asset-property-widget): correct time format handling [CTM-1293] #54

Merged
merged 2 commits into from
Sep 3, 2024
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 @@ -30,7 +30,7 @@
@Input() config: any;
computedPropertyObject: ComputedPropertyObject;
isLoading = true;
dateTimeFormat = 'yyyy-MM-ddThh:mm:ssZZZZZ';
dateTimeFormat = 'yyyy-MM-ddTHH:mm:ssZZZZZ';

constructor(
protected inventoryService: InventoryService,
Expand Down Expand Up @@ -260,7 +260,7 @@
property &&
!property.c8y_JsonSchema.properties[property.name].properties[
element.keyPath?.[1]
]?.hasOwnProperty('properties')

Check warning on line 263 in asset-properties-widget/component/asset-properties-view/asset-properties-view.component.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Do not access Object.prototype method 'hasOwnProperty' from target object
) {
if (!property.isParentKeySelected) {
property.isParentKeySelected = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

async getLastDeviceMessage(device: IManagedObject) {
// By incrementing the dateTo parameter by 1 day, this code aims to mitigate timezone-related inconsistencies.
const dateTimeFormat = 'yyyy-MM-ddThh:mm:ssZZZZZ';
const dateTimeFormat = 'yyyy-MM-ddTHH:mm:ssZZZZZ';
const filters = {
dateFrom: this.DEFAULT_FROM_DATE,
dateTo: this.datePipe.transform(new Date().setDate(new Date().getDate() + 1), dateTimeFormat),
Expand Down Expand Up @@ -141,7 +141,7 @@
.latestValueOfSpecificMeasurement$(
datapoint.fragment,
datapoint.series,
datapoint.__target.id,

Check warning on line 144 in asset-properties-widget/component/asset-properties-view/asset-properties-view.service.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected dangling '_' in '__target'
// we only need the last two values in case we want to show a trend
1
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cumulocity-asset-properties-widget-plugin",
"version": "1.1.0",
"version": "1.1.1",
"description": "Asset properties",
"author": "Amarjyoti Raj - Software AG, IOT-Apps R&D",
"license": "Apache 2.0",
Expand Down
Loading