How to use the fecha.format function in fecha

To help you get started, we’ve selected a few fecha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / F2 / test / unit / scale / cat-spec.js View on Github external
it('getTicks()', function() {
    const ticks = scale.getTicks();
    expect(typeof ticks[0]).to.be.equal('object');
    expect(ticks[1].value).to.be.equal(0.5);
    expect(ticks[1].text).to.be.equal(fecha.format(1442937600000, mask));
  });
github lpreterite / datagent / test / schema.js View on Github external
return val => {
            if (typeof val === 'string') return val;
            if (typeof val === "number") val = new Date(val);
            return fecha.format(val, format);
        }
    }
github ruiyong-lee / weapp-vue-eggjs-shop-demo / mobile_uni-app / src / common / util.js View on Github external
formatToDayTime(date = new Date()) {
    return fecha.format(date, 'YYYY-MM-DD HH:mm:ss');
  },
  formatDayStrToDayTimeStr(dateStr) {
github OpusCapita / filemanager / packages / connector-google-drive-v2 / src / list-view-layout.js View on Github external
function formatDate(
  viewLayoutOptions, { cellData, columnData, columnIndex, dataKey, isScrolling, rowData, rowIndex }
) {
  if (cellData) {
    const { dateTimePattern } = viewLayoutOptions;
    return fecha.format(new Date().setTime(cellData), dateTimePattern);
  }

  return '';
}
github webiny / webiny-js / packages-utils / webiny-i18n / src / index.js View on Github external
time(
        value: Date | string | number,
        outputFormat: ?string = null,
        inputFormat: string = "Y-m-dTH:i:sO"
    ): string {
        if (!outputFormat) {
            outputFormat = this.getTimeFormat();
        }

        if (!(value instanceof Date)) {
            value = fecha.parse(value, inputFormat);
        }

        return fecha.format(value, outputFormat);
    }
github s-h-a-d-o-w / spotify-ad-blocker / src / redirect-output.js View on Github external
process.stdout.write = function (string, encoding) {
		if(isDebug) {
			string = `${fecha.format(new Date(), "HH:mm:ss.SSS")}: ${string}`;
			stdoutFile.write(string, encoding);
		}
	};
github themeblvd / justwrite / src / components / Meta.js View on Github external
const Meta = props => {
  const date = fecha.format(new Date(props.date), 'shortDate');
  const author = props.authorData.find(author => author.id === props.author);

  return (
    <p>
      {author &amp;&amp; `By ${author.name}`} on {date}
    </p>
  );
};
github vue-generators / vue-form-generator / src / utils / validators.js View on Github external
return [msg(messages.invalidDate)];
		}

		let err = [];

		if (!isNil(field.min)) {
			let min = new Date(field.min);
			if (m.valueOf() &lt; min.valueOf()) {
				err.push(msg(messages.dateIsEarly, fecha.format(m), fecha.format(min)));
			}
		}

		if (!isNil(field.max)) {
			let max = new Date(field.max);
			if (m.valueOf() &gt; max.valueOf()) {
				err.push(msg(messages.dateIsLate, fecha.format(m), fecha.format(max)));
			}
		}

		return err;
	},
github antvis / L7 / src / scale / time.js View on Github external
getText(value) {
    const formatter = this.formatter;
    value = this.translate(value);
    value = formatter ? formatter(value) : fecha.format(value, this.mask);
    return value;
  }

fecha

Date formatting and parsing

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis