kristw commented on a change in pull request #5785: Handle "ambiguous durations"
URL:
https://github.com/apache/incubator-superset/pull/5785#discussion_r214378732
##########
File path: superset/assets/src/modules/time.js
##########
@@ -1,38 +1,155 @@
import parseIsoDuration from 'parse-iso-duration';
+export class IsoDuration {
+ /*
+ * Class that handles ambiguous durations like `P1M` or `P1Y`.
+ */
+
+ constructor(isoDuration) {
+ this.isoDuration = isoDuration;
+
+ // special cases not handled by parse-iso-duration
+ this.pattern = /P(\d+)(M|Y)/;
Review comment:
If this is a constant, declare outside class
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]