Tabnine Logo
ThreadLocalUserContext.getDateTimeZone
Code IndexAdd Tabnine to your IDE (free)

How to use
getDateTimeZone
method
in
org.projectforge.framework.persistence.user.api.ThreadLocalUserContext

Best Java code snippets using org.projectforge.framework.persistence.user.api.ThreadLocalUserContext.getDateTimeZone (Showing top 9 results out of 315)

origin: micromata/projectforge

Object parse(final String data)
{
 try {
  final DateTimeFormatter parseFormat = DateTimeFormat.forPattern(ISO_FORMAT);
  final DateTime date = parseFormat.withZone(DateTimeZone.UTC).parseDateTime(data);
  final DateTimeZone dateTimeZone = ThreadLocalUserContext.getDateTimeZone();
  return new DateTime(date, dateTimeZone);
 } catch (final Exception ex) {
  log.error("Can't parse DateMidnight: " + data);
  return new DateMidnight();
 }
}
origin: micromata/projectforge

public JodaDateConverter()
{
 this.userDateFormat = getPattern();
 this.timeZone = ThreadLocalUserContext.getDateTimeZone();
 this.currentYear = new DateMidnight(timeZone).getYear();
}
origin: micromata/projectforge

/**
 * @param startDate
 * @return this for chaining.
 */
public CalendarPage setStartDate(final Date startDate)
{
 form.getFilter().setStartDate(new DateMidnight(startDate, ThreadLocalUserContext.getDateTimeZone()));
 return this;
}
origin: micromata/projectforge

DateTime holidaysFrom = new DateTime(ThreadLocalUserContext.getDateTimeZone());
holidaysFrom = holidaysFrom.dayOfYear().withMinimumValue().millisOfDay().withMinimumValue().minusYears(2);
final DateTime holidayTo = holidaysFrom.plusYears(6);
origin: micromata/projectforge

 private List<TimesheetDO> findTimesheets()
 {
  final DateTimeZone usersTimeZone = ThreadLocalUserContext.getDateTimeZone();
  final Date fromDate = form.getTimePeriod().getFromDate();
  final DateTime startDate = new DateTime(fromDate, usersTimeZone).withDayOfWeek(DateTimeConstants.MONDAY);
  final TimesheetFilter tf = new TimesheetFilter();
  //ASC = Montag bis Sonntag
  tf.setOrderType(OrderDirection.ASC);
  tf.setStartTime(startDate.toDate());
  tf.setUserId(this.getUserId());

  //stopDate auf Sonntag 23:59:59.999 setzten um alle Eintragungen aus der Woche zu bekommen
  DateTime stopDate = startDate.withDayOfWeek(DateTimeConstants.SUNDAY);
  stopDate = stopDate.plusHours(23);
  stopDate = stopDate.plusMinutes(59);
  stopDate = stopDate.plusSeconds(59);
  stopDate = stopDate.plusMillis(999);
  tf.setStopTime(stopDate.toDate());
  tf.setRecursive(true);

  return timesheetDao.getList(tf);
 }
}
origin: micromata/projectforge

 continue;
final DateTime week = new DateTime(planning.getWeek(), ThreadLocalUserContext.getDateTimeZone());
for (final HRPlanningEntryDO entry : planning.getEntries()) {
 if (entry.isDeleted() == true) {
origin: micromata/projectforge

@Override
protected void respond(final AjaxRequestTarget target)
{
 final Request r = target.getPage().getRequest();
 final ViewType type = ViewType.forCode(r.getRequestParameters().getParameterValue("view").toString());
 final DateTimeFormatter fmt = ISODateTimeFormat.dateTimeParser().withZone(ThreadLocalUserContext.getDateTimeZone());
 final DateMidnight start = fmt.parseDateTime(r.getRequestParameters().getParameterValue("start").toString())
   .toDateMidnight();
 final DateMidnight end = fmt.parseDateTime(r.getRequestParameters().getParameterValue("end").toString())
   .toDateMidnight();
 final DateMidnight visibleStart = fmt.parseDateTime(
   r.getRequestParameters().getParameterValue("visibleStart").toString()).toDateMidnight();
 final DateMidnight visibleEnd = fmt
   .parseDateTime(r.getRequestParameters().getParameterValue("visibleEnd").toString()).toDateMidnight();
 final View view = new View(type, start, end, visibleStart, visibleEnd);
 final CalendarResponse response = new CalendarResponse(getCalendar(), target);
 onViewDisplayed(view, response);
}
origin: micromata/projectforge

} else {
 final DateTime currentMonth = new DateTime(start.plusDays(10), ThreadLocalUserContext.getDateTimeZone()); // Now we're definitely in the right
 DateTime lastStopTime = null;
 for (final TimesheetDO timesheet : timesheets) {
  final DateTime startTime = new DateTime(timesheet.getStartTime(), ThreadLocalUserContext.getDateTimeZone());
  final DateTime stopTime = new DateTime(timesheet.getStopTime(), ThreadLocalUserContext.getDateTimeZone());
  if (stopTime.isBefore(start) == true || startTime.isAfter(end) == true) {
origin: micromata/projectforge

final DateTimeZone dateTimeZone = eventDO.isAllDay() ? DateTimeZone.forTimeZone(DateHelper.UTC) : ThreadLocalUserContext.getDateTimeZone();
final DateTime startDate = new DateTime(teamEvent.getStartDate(), dateTimeZone);
final DateTime endDate = new DateTime(teamEvent.getEndDate(), dateTimeZone);
org.projectforge.framework.persistence.user.apiThreadLocalUserContextgetDateTimeZone

Popular methods of ThreadLocalUserContext

  • getUser
  • getLocalizedString
  • getTimeZone
  • getUserId
  • getLocale
    If context user's locale is null and the given defaultLocale is not null, then the context user's cl
  • setUser
    If given user is null, #clear() is called.
  • clear
  • getLocalizedMessage
  • getUserContext
  • setUserContext
  • getCalendarFirstDayOfWeek
    The first day of the week, configured at the given user, if not configured ConfigXml#getFirstDayOfWe
  • getJodaFirstDayOfWeek
  • getCalendarFirstDayOfWeek,
  • getJodaFirstDayOfWeek

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now