handleSlidingComplete = (value: number) => {
    const { info, updateInfo } = this.props;
    const dateTime = info.date ? DateTime.fromJSDate(info.date) : DateTime.local();
    const date = dateTime.set({ hours: 0, minutes: 0 }).plus({ minutes: value }).toJSDate();

    updateInfo({ date });
  }
Exemple #2
0
router.get("/list/:date?", async (req, res) => {
  try {
    const terminService = req.app.get('terminService')
    const today = req.params.date ? DateTime.fromFormat(req.params.date, "yyyyLLdd") : DateTime.local().set({ hour: 0, minute: 0, second: 0 })
    const resource = await terminService.get("resource")
    sitedef = await terminService.get("site")
    const f1 = await terminService.find({
      query: {
        date: today.toFormat("yyyyLLdd"),
        resource
      }
    })
    const slots = f1.map(slot => {
      const minutes = parseInt(slot.beginn)
      const appnt = today.plus({ minutes })
      return {
        human: appnt.toFormat("HH:mm"),
        id: today.toFormat("yyyyLLdd") + slot.beginn.toString,
        appnt: JSON.stringify(slot)
      }
    })
    const wday = today.weekday
    const tdate = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"][wday - 1] + ", " + today.toFormat("dd.LL.yyyy")
    const nextDay = today.plus({ day: 1 }).toFormat("yyyyLLdd")
    const prevDay = today.minus({ day: 1 }).toFormat("yyyyLLdd")
    res.render("termin", {
      title: "Termin",
      slots, tdate, nextDay, prevDay, sitedef
    })
  } catch (err) {
    res.render("error", {
      message: "Interner Fehler", error: err, sitedef
    })
  }
})
function updateDatesInActivity(activity) {
  const start = (activity.state.startUnix && !isNaN(activity.state.startUnix)) ? DateTime.fromMillis(activity.state.startUnix * 1000) : DateTime.local();
  activity.state.startDate = start.set({millisecond: 0, second: 0}).setZone('Europe/Berlin').toJSDate();

  const end = (activity.state.endUnix && !isNaN(activity.state.endUnix)) ? DateTime.fromMillis(activity.state.endUnix * 1000) : DateTime.local();
  activity.state.endDate = end.set({millisecond: 0, second: 0}).setZone('Europe/Berlin').toJSDate();
}
  it("successfuly save a new api hour", async () => {
    const info = {
      version: 38,
      location: "celtill",
      address: "11 rue Niel 63100 Clermont-Ferrand",
      date: DateTime.local(),
      eventbrite_date: DateTime.local()
    };

    const talks = [
      {
        peaker: "foo",
        title: "bar",
        description: "baz",
        longTalk: true,
        newTalk: true,
        slug: "slug"
      }
    ];

    const date = DateTime.local()
      .setLocale("fr")
      .toFormat("yyyy-LL-dd");

    const readFile = jest.fn(() => Promise.resolve("foo"));
    const writeFile = jest.fn(() => Promise.resolve());
    // readFile
    promisify.mockImplementationOnce(() => readFile);

    //writeFile
    promisify.mockImplementationOnce(() => writeFile);

    get.mockImplementationOnce(() =>
      Promise.resolve(
        JSON.stringify([
          {
            boundingbox: ["45.7813783", "45.7814913", "3.1041998", "3.1043267"],
            lat: "45.7814518",
            lon: "3.1042658"
          }
        ])
      )
    );

    render.mockImplementationOnce(() => "rendered template");

    await apiHour(info, date, talks);

    expect(readFile.mock.calls.length).toEqual(1);
    expect(writeFile.mock.calls.length).toEqual(1);
    expect(writeFile.mock.calls[0][0]).toEqual(
      __dirname + "/../../_posts/" + date + "-api-hour-38.md"
    );
    expect(writeFile.mock.calls[0][1]).toEqual("rendered template");
    expect(render.mock.calls.length).toEqual(1);
    expect(render.mock.calls[0][0]).toEqual("foo");
  });
export const userHeroCardViewInfoSelector = (state: State): HeroCardViewInfo => {
  const { birthday, city, height: hData, weight: wData, weight_unit: wUnit } = state.user.data;
  const height = hData ? `${Number(hData).toFixed(2)} m` : undefined;
  const weight = wData ? `${Number(wData).toFixed(0)} ${wUnit}` : undefined;
  const name = formatText.name(state.user.data.first_name, state.user.data.last_name);
  const torchId = state.user.data.hero_page.torch_id;
  const age = birthday ? DateTime.local().diff(DateTime.fromISO(birthday), 'years').toObject().years : undefined;
  const fans = fansCountSelector(state);

  return { name, torchId, city, age, height, weight, fans };
};
Exemple #6
0
  meetupDateToActivityTimes: function meetupDateToActivityTimes(meetupStartDate, meetupStartTime, durationInMillis) {
    DateTime.fromFormat(meetupStartDate + ' ' + meetupStartTime, 'yyyy-MM-dd H:m', { zone: this.defaultTimezone() });
    const startPoint = DateTime.fromFormat(meetupStartDate + ' ' + meetupStartTime, 'yyyy-MM-dd H:m', { zone: this.defaultTimezone() });
    const endPoint = startPoint.plus({seconds: durationInMillis / 1000});

    return {
      startDate: startPoint.toFormat('dd.MM.yyyy'),
      startTime: startPoint.toFormat('HH:mm'),
      endDate: endPoint.toFormat('dd.MM.yyyy'),
      endTime: endPoint.toFormat('HH:mm')
    };
  },
 const parseDate = str => {
   if (str instanceof Date) {
     return str
   }
   const date = DateTime.fromISO(str, { zone: 'utc' })
   return date.toJSDate()
 }
  componentWillMount() {
    const { date } = this.props.info;

    if (date) {
      this.setState({ time: DateTime.fromJSDate(date) });
    }
  }
 load(activityResultName, (err, activityResult) => {
   /* eslint camelcase: 0 */
   if (err) { return cb(err); }
   let date = new Date();
   if (metadata && metadata.exif) {
     date = metadata.exif.dateTime || metadata.exif.dateTimeOriginal || metadata.exif.dateTimeDigitized || new Date();
   }
   const picturesDate = DateTime.fromJSDate(date);
   const now = DateTime.local();
   activityResult.addPhoto({
     id: imageUri,
     timestamp: (picturesDate < now ? picturesDate : now).toJSDate(),
     uploaded_by: memberId
   });
   persistence.save(activityResult.state, err1 => cb(err1, imageUri));
 });
  setSubtitle = (props: Props = this.props) => {
    const { currentScreen, info, action, name } = props;
    const { type, date } = info;
    const isGame = type.indexOf('game') > -1;
    let subtitle;

    if (currentScreen === 'Info') {
      if (!type) {
        subtitle = 'SELECT EVENT TYPE';
      } else if (date) {
        const dateString = DateTime.fromJSDate(date).toLocaleString({ month: 'long', day: 'numeric' }).toUpperCase();
        subtitle = isGame ? `SELECT GAME TIME FOR ${dateString}` : `SELECT TIME FOR ${dateString}`;
      } else if (!date) {
        subtitle = isGame ? 'SELECT GAME DAY' : 'SELECT DAY';
      }
    } else if (currentScreen === 'Details') {
      if (isGame) {
        subtitle = name ? `VS ${name.toUpperCase()}` : 'ADD OPONENT';
      } else {
        subtitle = 'EVENT DETAILS';
      }

      switch (action) {
        case 'name': subtitle = isGame ? subtitle : 'NAME EVENT'; break;
        case 'recurring': subtitle = 'RECURRING EVENT'; break;
        case 'location': subtitle = 'SET LOCATION'; break;
        case 'note': subtitle = 'ENTER NOTE'; break;
        default: break;
      }
    }

    this.setState({ subtitle });
  }
function getWeather({ longitude, latitude }) {
  const now = DateTime.local().toString();
  const options = {
    latitude,
    longitude,
    time: now
  };

  const requestPromise = axios
    .post("https://weather-the-weather-proxy.glitch.me/", options)
    .then(response => {
      const [today, yesterday] = response.data;
      const todaysTemp = today.currently.apparentTemperature;
      const icon = today.currently.icon;
      const yesterdaysTemp = yesterday.currently.apparentTemperature;

      return {
        todaysTemp,
        yesterdaysTemp,
        icon
      };
    });

  return requestPromise;
}
Exemple #12
0
	eleventyConfig.addNunjucksFilter("rssNewestUpdatedDate", collection => {
		if( !collection || !collection.length ) {
			throw new Error( "Collection is empty in lastUpdatedDate filter." );
		}

		return DateTime.fromJSDate(collection[ 0 ].date).toISO({ includeOffset: true, suppressMilliseconds: true });
	});
Exemple #13
0
 initFromSessionUser(sessionUser) {
   /* eslint no-underscore-dangle: 0 */
   // this is THE ONLY VALID WAY to create and initialize a new user in real life (not tests)
   if (!sessionUser || this.id()) {
     return this;
   }
   this.state.created = DateTime.local().toFormat('dd.MM.yy');
   this.state.id = sessionUser.authenticationId;
   const profile = sessionUser.profile;
   if (profile) {
     this.state.email = fieldHelpers.valueOrFallback(profile.emails && profile.emails[0] && profile.emails[0].value, this.email());
     const name = profile.name;
     if (name) {
       this.state.firstname = fieldHelpers.valueOrFallback(name.givenName, this.firstname());
       this.state.lastname = fieldHelpers.valueOrFallback(name.familyName, this.lastname());
     }
     if (profile.password) {
       this.updatePassword(profile.password);
     }
     this.state.site = fieldHelpers.valueOrFallback(profile.profileUrl, this.site());
     if (profile._json && fieldHelpers.isFilled(profile._json.blog)) {
       this.state.site += (this.site() ? ', ' : '') + fieldHelpers.addPrefixTo('http://', profile._json.blog, 'https://');
     }
   }
   return this;
 }
Exemple #14
0
 {groups[year].map(({ node }) => (
   <li key={node.fileAbsolutePath}>
     <Link to={node.fields.url}>{node.frontmatter.title}</Link> ({DateTime.fromISO(
       node.frontmatter.date
     ).toFormat('MMMM d')})
   </li>
 ))}
Exemple #15
0
router.post("/set", async (req, res) => {
  const appnt = req.body.appnts
  const email = req.body.email
  const dob = req.body.bdate
  const grund = req.body.reason
  const sendmail=req.body.sendmail
  const terminService = req.app.get("terminService")
  try {
    const termin = await terminService.create({ appnt, email, dob, grund, sendmail })
    const dt = DateTime.fromFormat(termin.tag, "yyyyLLdd")
    const human = dt.plus({ "minutes": parseInt(termin.beginn) }).toFormat("dd.LL.yyyy, HH:mm ") + "Uhr"
    res.render("terminok", {
      appnt: termin, human, sitedef
    })
  } catch (err) {
    if (err.message === "PATIENT_NOT_FOUND") {
      res.render("baddata", {
        errmsg: "Es konnte kein Patient mit diesen Daten gefunden werden. Bitte teilen Sie uns ggf. Ihre E-Mail Adresse mit. Selbstverständlich können Sie auch telefonisch einen Termin vereinbaren.",
        sitedef
      })
    } else {
      res.render("baddata", { errmsg: err.message })
    }
  }
})
Exemple #16
0
 parseToDateTimeUsingTimezone: function parseToDateTimeUsingTimezone(dateString, timeString, timezoneName) {
   if (dateString) {
     const timeStringOrDefault = timeString || '00:00';
     return DateTime.fromFormat(dateString + ' ' + timeStringOrDefault, 'd.M.yyyy H:m', { zone: timezoneName });
   }
   return undefined;
 },
function getDisplayRecurring(date, { frequency, days }) {
  const dateTime = date ? DateTime.fromJSDate(date) : DateTime.local();
  const weekNumber = Math.ceil(Number(dateTime.toFormat('d')) / 7);

  if (days.length === 7) {
    if (frequency === 'every_other_week') {
      return 'EVERY OTHER WEEK';
    } else if (frequency === 'every_month') {
      return `EVERY ${format.ordinalSuffix(weekNumber).toUpperCase()} WEEK`;
    }
    return 'EVERY WEEK';
  }

  if (days.length === 5 && !days.includes(6) && !days.includes(7)) {
    if (frequency === 'every_other_week') {
      return 'EVERY OTHER WEEKDAY';
    } else if (frequency === 'every_month') {
      return `EVERY ${format.ordinalSuffix(weekNumber).toUpperCase()} WEEKDAY`;
    }
    return 'EVERY WEEKDAY';
  }

  if (days.length === 2 && days.includes(6) && days.includes(7)) {
    if (frequency === 'every_other_week') {
      return 'EVERY OTHER WEEKEND';
    } else if (frequency === 'every_month') {
      return `EVERY ${format.ordinalSuffix(weekNumber).toUpperCase()} WEEKEND`;
    }
    return 'EVERY WEEKEND';
  }

  let displayFrequency = 'EVERY';
  if (frequency === 'every_other_week') {
    displayFrequency = 'EVERY OTHER';
  } else if (frequency === 'every_month') {
    displayFrequency = `EVERY ${format.ordinalSuffix(weekNumber).toUpperCase()}`;
  }

  const displayDays = days
    .sort((a, b) => a - b)
    .map(day => format.weekday(day, 'cccc'))
    .join(', ')
    .toUpperCase();

  return `${displayFrequency} ${displayDays}`;
}
Exemple #18
0
export function formatFirstPlayed(val: Date | Timestamp | null): string {
  if (!val) {
    return '';
  } else if (val.timestamp) {
    return DateTime.fromMillis(val.timestamp, { zone: 'utc' }).toFormat('d MMM yyyy HH:mm');
  } else {
    if (val.day) {
      return DateTime.utc(val.year, val.month, val.day).toFormat('d MMM yyyy');
    } else if (val.month) {
      return DateTime.utc(val.year, val.month).toFormat('MMM yyyy');
    } else if (val.year) {
      return DateTime.utc(val.year).toFormat('yyyy');
    } else {
      return '';
    }
  }
}
Exemple #19
0
const store = () => {
  const store = new Vuex.Store({
    modules: { opts },

    state: {
      now: '',
      screenTypes: {
        '2D': '2D',
        '3D': '3D',
        '2D-IMAX': 'IMAX',
        '3D-IMAX': 'IMAX 3D',
        '3D-4DX': '4DX',
        '2D-4DX': '4DX (2D)',
      },
    },

    mutations: {
      updateTime(state, now) {
        state.now = now;
      },
    },

    getters: {
      ztime(state) {
        return state.now ? state.now.toFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") : '';
      },
    },

    actions: {
      start({ dispatch }) {
        dispatch('now');
        setInterval(() => dispatch('now'), 1000 * 60);
      },

      now({ commit, state }) {
        const d = DateTime.local();
        const today = d.toISODate();

        commit('updateTime', d);

        if (
          today > state.opts.currentDay ||
          d.plus({ days: 4 }).toISODate() < state.opts.currentDay
        ) {
          commit('opts/setDay', today);
        }
      },
    },
  });

  store.subscribe((mutation, state) => {
    if (typeof localStorage != 'undefined') {
      localStorage.opts = JSON.stringify(state.opts);
    }
  });

  return store;
};
Exemple #20
0
function raiseLockFileIssue(err) {
  logger.debug('raiseLockFileIssue()');
  if (!err.releaseTimestamp) {
    logger.warn('lock file error without release timestamp');
    return;
  }
  let body =
    'Renovate encountered an error when updating a lock file, and this may need your manual intervention to resolve. ';
  body +=
    "It's possible that this lock file problem could prevent most or all PRs from being created. ";
  body +=
    'Renovate will close this issue automatically if it no longer experiences any lock file updating errors (such as if this was a temporary error).\n\n';
  body +=
    'The most common cause for failed lock file updating is the use of private npm modules or a private npm server while Renovate has been given no credentials to download them. ';
  body +=
    "If this is the case, then please check out Renovate's [private module support documentation](https://renovatebot.com/docs/private-modules/).\n\n\n";
  body +=
    'If you just want this error to go away, the simplest options are either:\n';
  body += ' - Delete any lockfiles you do not care about, or \n';
  body +=
    ' - Add setting `updateLockFiles=false` to your renovate config and Renovate will skip lock files in PRs. This is not recommended in most circumstances because then your lock file is invalidated.\n\n';
  body += `File name: \`${err.fileName}\`\n\n`;
  body += `Details:\n\n`;
  body += '```\n';
  const details = (err.details || '')
    .replace(/npm ERR! A complete log of this run can be found in.*\n.*/g, '')
    .replace(/\n+$/, '');
  body += `${details}\n`;
  body += '```\n';
  const releaseTimestamp = DateTime.fromISO(err.releaseTimestamp);
  if (releaseTimestamp.plus({ days: 1 }) < DateTime.local()) {
    /*
    const res = await platform.ensureIssue(
      'Action Required: Fix Renovate Configuration',
      body
    );
    logger.info('Lock file warning issue: ' + res);
    */
    logger.warn(
      { body },
      'Failed lockfile generation for release over one day old'
    );
  }
}
    test('has info', () => {
      const info = {
        type: '',
        date: DateTime.local().toJSDate(),
        amPm: false,
      };
      const state = eventSettingsReducer(undefined, actions.updateInfoAction(info));

      expect(state).toMatchSnapshot();
    });
  handleValueChange = (value: number) => {
    const { valueChanged } = this.state;
    const time = DateTime.fromObject({ hour: 0, minutes: 0 }).plus({ minutes: value });

    if (!valueChanged) {
      this.setState({ time, valueChanged: true });
    } else {
      this.setState({ time });
    }
  }
  fileInputChanged = async (event) => {
    let file = event.target.files[0];
    this.setState({uploading: true});

    let filename = `${DateTime.local().toISO()}-${Math.random()}-${file.name}`;
    let ref = storage.ref().child('displays').child(this.props.displayId).child('images').child(filename);
    await ref.put(file);

    this.setState({uploading: false});
    this.onChange(filename);
  }
Exemple #24
0
const formatDate = (profile, when) => {
	let timezone
	if (timezones.has(profile)) timezone = timezones.get(profile)
	else {
		timezone = new IANAZone(profile.timezone)
		timezones.set(profile, timezone)
	}

	return DateTime.fromMillis(+when, {
		locale: profile.locale,
		zone: timezone
	}).toFormat('yyyyMMdd')
}
  it("throws an error when it is not possible to read template file", async () => {
    const info = {
      version: 38,
      location: "celtill",
      address: "11 rue Niel 63100 Clermont-Ferrand",
      date: DateTime.local(),
      eventbrite_date: DateTime.local()
    };

    const talks = [
      {
        peaker: "foo",
        title: "bar",
        description: "baz",
        longTalk: true,
        newTalk: true,
        slug: "slug"
      }
    ];

    const date = DateTime.local()
      .setLocale("fr")
      .toFormat("yyyy-LL-dd");

    const readFile = jest.fn(() => Promise.reject());
    const writeFile = jest.fn(() => Promise.resolve());
    // readFile
    promisify.mockImplementationOnce(() => readFile);

    //writeFile
    promisify.mockImplementationOnce(() => writeFile);
    expect.assertions(1);

    try {
      await apiHour(info, date, talks);
    } catch (e) {
      expect(e.message).toEqual("impossible to open api hour template");
    }
  });
    it('should be updatable by id in title, tags and timestamp', () => {
      const activityResult = new ActivityResult({
        id: 'whatever',
        photos: [
          {id: 'my_photo_id', title: 'Title'}
        ]
      });

      const date = DateTime.fromISO('2014-02-20T12:00:00Z');
      activityResult.updatePhotoById('my_photo_id', {title: 'newTitle', tags: ['peter', 'paul'], timestamp: date.toJSDate()});
      expect(activityResult.getPhotoById('my_photo_id').title()).to.be('newTitle');
      expect(activityResult.getPhotoById('my_photo_id').tags()).to.eql(['peter', 'paul']);
      expect(activityResult.getPhotoById('my_photo_id').time()).to.eql(date);
    });
  describe('preparation for display', () => {
    const timestamp1 = DateTime.fromISO('2014-02-20T12:00:00Z').toJSDate();
    const timestamp2 = DateTime.fromISO('2014-02-20T12:01:00Z').toJSDate();
    const timestamp3 = DateTime.fromISO('2014-02-21T12:01:00Z').toJSDate();

    it('creates a list of "day" objects', () => {
      const activityResult = new ActivityResult({
        id: 'ar_id',
        photos: [{id: 'image1.jpg', tags: ['tag1'], timestamp: timestamp1}, {id: 'image2.jpg', tags: ['tag1'], timestamp: timestamp2}]
      });
      expect(activityResult.photosByDay()).to.have.length(1);
      expect(activityResult.photosByDay()[0].day.setLocale('de').toLocaleString(DateTime.DATE_SHORT)).to.be('20.2.2014');
      expect(activityResult.photosByDay()[0].photosByTag).to.have.ownKeys(['tag1']);
      expect(activityResult.photosByDay()[0].photosByTag.tag1).to.have.length(2);
    });

    it('sorts the photos by time', () => {
      const activityResult = new ActivityResult({
        id: 'ar_id',
        photos: [{id: 'image2.jpg', tags: ['tag1'], timestamp: timestamp2}, {id: 'image1.jpg', tags: ['tag1'], timestamp: timestamp1}]
      });
      const photosOfTag1 = activityResult.photosByDay()[0].photosByTag.tag1;
      expect(photosOfTag1[0].state).to.have.ownProperty('id', 'image1.jpg');
      expect(photosOfTag1[1].state).to.have.ownProperty('id', 'image2.jpg');
    });

    it('sorts the days by time descending', () => {
      const activityResult = new ActivityResult({
        id: 'ar_id',
        photos: [{id: 'image1.jpg', tags: ['tag1'], timestamp: timestamp1}, {id: 'image2.jpg', tags: ['tag1'], timestamp: timestamp3}]
      });
      expect(activityResult.photosByDay()).to.have.length(2);
      expect(activityResult.photosByDay()[0].day.setLocale('de').toLocaleString(DateTime.DATE_SHORT)).to.be('21.2.2014');
      expect(activityResult.photosByDay()[1].day.setLocale('de').toLocaleString(DateTime.DATE_SHORT)).to.be('20.2.2014');
    });
  });
 .map(s => (
   <Card key={s.title} style={{ width: "100%" }}>
     <CardBody>
       <Mutation
         mutation={gql`
           mutation ImportMission($url: String!) {
             importMissionFromUrl(url: $url)
           }
         `}
         variables={{ url: s.url }}
       >
         {(action, { loading }) =>
           !loading && (
             <Button
               style={{ float: "right" }}
               color="success"
               onClick={() => {
                 triggerAlert({
                   color: "info",
                   title: "Downloading mission...",
                   body:
                     "This mission is downloading in the background. Don't turn off Thorium Server. You can monitor download progress on your Thorium Server window."
                 });
                 action();
               }}
             >
               Download
             </Button>
           )
         }
       </Mutation>
       <h3>{s.title}</h3>
       <div>Author: {s.author}</div>
       <div>
         Date Published:{" "}
         {DateTime.fromJSDate(
           new Date(s.date)
         ).toFormat("D")}
       </div>
       <div>Description:</div>
       <div>{s.description}</div>
     </CardBody>
   </Card>
 ))
module.exports = async () => {
  const answers = await prompt(questions);
  const talkAnswers = [];

  let newTalk = false;
  const AHdate = DateTime.fromJSDate(answers.date);
  AHdate.setLocale("fr");
  const printedDate = AHdate.toFormat("yyyy-LL-dd");

  do {
    const talkAnswer = await prompt(talkQuestion);
    newTalk = talkAnswer.newTalk;
    talkAnswers.push({
      slug:
        printedDate +
        "-" +
        slugify(talkAnswer.speaker) +
        "-" +
        slugify(talkAnswer.title),
      ...talkAnswer
    });
  } while (newTalk === true);

  try {
    await apiHourGenerator(answers, printedDate, talkAnswers);
  } catch (e) {
    console.error(e.message);
    process.exit(1);
  }

  try {
    talkAnswers.forEach(async talk => {
      await talkGenerator(talk, answers.version);
    });
  } catch (e) {
    console.error(e.message);
    process.exit(1);
  }
};
Exemple #30
0
router.post("/set", (req, res, next) => {
  const appnt = req.body.appnts
  const email = req.body.email
  const bdate = req.body.bdate
  if (!appnt || !email || !bdate) {
    res.render("baddata", {
      errmsg: "Der Termin kann nur vereinbart werden, wenn Sie alle Felder ausfüllen. Bitte wählen Sie einen Termin aus, und geben Sie Ihre E-Mail Adresse und Ihr Geburtsdatum an.",
      sitedef
    })
  } else {
    const bdate_split = bdate.split(/\s*\.\s*/)
    const bdate_parsed = DateTime.fromObject({ day: parseInt(bdate_split[0]), month: parseInt(bdate_split[1]), year: parseInt(bdate_split[2]) })
    if (bdate_parsed.isValid) {
      req.body.bdate = bdate_parsed.toFormat("yyyyLLdd")
      next()
    } else {
      res.render("baddata", {
        errmsg: 'Das Geburtsdatum konnte nicht interpretiert werden. Bitte geben Sie es in der Form "Tag.Monat.Jahr" ein, wie zum Beispiel "1.4.1970"',
        sitedef
      })
    }

  }
})