Skip to content

Commit 8a22a2d

Browse files
committed
INT: fixed bug with data string value type
1 parent a8cc2ee commit 8a22a2d

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Version 8.0.1 (2024-06-26)
4+
5+
### Bug Fixes
6+
7+
- fixed bug with parsing user input for `DataString` value type
8+
39
## Version 8.0.0 (2024-01-25)
410

511
### Features

src/misc/utils.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,15 @@ export function parseRawInput<TDate>(rawValue: string,
211211
* @param dateApi - Date api for manipulation with date
212212
* @param dateTimeData - Object storing information about format
213213
* @param valueProvider - Provider used for obtaining rounded value according format
214+
* @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input
214215
*/
215216
export function getInternalValue<TDate>(value: DateTimeInputOutputValue<TDate>|undefined|null,
216217
dateApi: DateApi<TDate>,
217218
dateTimeData: DateTimeSADirective<TDate>,
218-
valueProvider: DateValueProvider<TDate>,): DateTimeObjectValue<TDate>|undefined|null
219+
valueProvider: DateValueProvider<TDate>,
220+
dateTimeFormat: DateTimeValueFormat|undefined|null = null,): DateTimeObjectValue<TDate>|undefined|null
219221
{
220-
let internalValue = parseDateTime(value, dateApi, null, dateTimeData.customFormat, dateTimeData.dataFormat);
222+
let internalValue = parseDateTime(value, dateApi, dateTimeFormat, dateTimeData.customFormat, dateTimeData.dataFormat);
221223

222224
if(isBlank(internalValue))
223225
{

src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/ty
77
import {formatDateTime, getInternalValue} from '../../../../misc/utils';
88
import {DateApi, DateValueProvider} from '../../../../services';
99
import {DateTimeBase} from '../dateTimeBase';
10+
import {DateTimeValueFormat} from '../../../../misc/enums';
1011

1112
//TODO: range is unimplemented
1213

@@ -135,10 +136,12 @@ export class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDat
135136
/**
136137
* Sets internal value and fix lowest time difference
137138
* @param value - Value to be set
139+
* @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input
138140
*/
139-
protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void
141+
protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null,
142+
dateTimeFormat: DateTimeValueFormat|undefined|null = null,): void
140143
{
141-
this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider);
144+
this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider, dateTimeFormat);
142145
}
143146

144147
/**
@@ -157,7 +160,7 @@ export class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDat
157160
return;
158161
}
159162

160-
this.setInternalValue(this.rawValue);
163+
this.setInternalValue(this.rawValue, DateTimeValueFormat.FormattedString);
161164
this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
162165

163166
this.valueChange.next();

0 commit comments

Comments
 (0)