Skip to content

Commit

Permalink
Merge pull request #353 from toggle-corp/fix-hacked-formatted-date
Browse files Browse the repository at this point in the history
Add HackedFormattedDate.format
  • Loading branch information
thenav56 authored Sep 27, 2018
2 parents 64f439c + e9b0d22 commit 271ad98
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/General/Bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Bundle extends React.Component {

handleLoad = (BundledComponent) => {
if (!this.mounted) {
console.error('Bundle unmounted while loading Component.');
console.warn('Bundle unmounted while loading Component.');
return;
}

Expand All @@ -64,11 +64,11 @@ class Bundle extends React.Component {

handleLoadError = (err) => {
if (!this.mounted) {
console.error('Bundle unmounted while loading Component.');
console.warn('Bundle unmounted while loading Component.');
return;
}
this.setState({ failed: true });
console.error('Bundle load failed.', err);
console.warn('Bundle load failed.', err);
}

renderLoading = ({ text }) => (
Expand Down
2 changes: 1 addition & 1 deletion components/Input/DateFilter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class DateFilter extends React.PureComponent {
break;
}
default:
console.error(`Invalid type: ${type}`);
console.error(`Invalid date range type: ${type}`);
}

return {
Expand Down
2 changes: 2 additions & 0 deletions components/View/FormattedDate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ HackedFormattedDate.defaultProps = {
value: undefined,
};

HackedFormattedDate.format = FormattedDate.format;

export default HackedFormattedDate;
5 changes: 4 additions & 1 deletion utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ export const getRatingForContentInString = (content = '', str) => (

// MISC

// NOTE: used in debugger
export const findDifferenceInObject = (o, n) => {
const allKeys = new Set([
...Object.keys(o),
Expand All @@ -774,6 +775,7 @@ export const findDifferenceInObject = (o, n) => {
return changes;
};

// NOTE: used in Faram:validator
export const findDifferenceInList = (listA, listB, keySelector) => {
const modified = [];
const added = [];
Expand Down Expand Up @@ -815,6 +817,7 @@ export const checkVersion = (oldVersionId, newVersionId) => ({
isValueOverriden: isTruthy(oldVersionId) && oldVersionId < newVersionId,
});

// NOTE: only used in chord diagram; maybe on deep
// save the svg node element
export const saveSvg = (svgElement, name) => {
svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
Expand All @@ -830,7 +833,7 @@ export const saveSvg = (svgElement, name) => {
document.body.removeChild(downloadLink);
};

export const getClassNameListAndIndex = (el, className) => {
const getClassNameListAndIndex = (el, className) => {
const classNameList = (el.getAttribute('class')).split(' ');
const index = classNameList.findIndex(d => d === className);

Expand Down
2 changes: 1 addition & 1 deletion utils/rest/RestRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class RestRequest {
return;
}
// NOTE: a network problem may occur
console.error(ex);
console.warn(ex);
const retrySuccessful = this.retry();
if (!retrySuccessful) {
this.fatal({ errorMessage: ex.message, errorCode: ex.statusCode });
Expand Down

0 comments on commit 271ad98

Please sign in to comment.