PHP Classes

File: vendors/moment/src/lib/units/day-of-year.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/moment/src/lib/units/day-of-year.js   Download  
File: vendors/moment/src/lib/units/day-of-year.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 896 bytes
 

Contents

Class file image Download
import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; import { addRegexToken, match3, match1to3 } from '../parse/regex'; import { daysInYear } from './year'; import { createUTCDate } from '../create/date-from-array'; import { addParseToken } from '../parse/token'; import toInt from '../utils/to-int'; // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES addUnitAlias('dayOfYear', 'DDD'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS export function getSetDayOfYear (input) { var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); }